mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Clear search on selector toggle
This commit is contained in:
parent
3eb99c8a3e
commit
e3bd3eda4f
1 changed files with 6 additions and 1 deletions
|
@ -54,6 +54,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
modal?.show();
|
modal?.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleModal() {
|
||||||
|
modal?.toggle();
|
||||||
|
searchQuery = "";
|
||||||
|
}
|
||||||
|
|
||||||
export function select(itemId: bigint) {
|
export function select(itemId: bigint) {
|
||||||
const item = items.find((item) => item.id === itemId);
|
const item = items.find((item) => item.id === itemId);
|
||||||
selectedItem = item ? item : null;
|
selectedItem = item ? item : null;
|
||||||
|
@ -70,7 +75,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
{selectedItem?.name ?? "…"}
|
{selectedItem?.name ?? "…"}
|
||||||
</LabelButton>
|
</LabelButton>
|
||||||
|
|
||||||
<Shortcut {keyCombination} on:action={() => modal?.toggle()} />
|
<Shortcut {keyCombination} on:action={toggleModal} />
|
||||||
<Modal bind:this={modal} onShown={() => searchInput?.focus()} dialogClass="modal-lg">
|
<Modal bind:this={modal} onShown={() => searchInput?.focus()} dialogClass="modal-lg">
|
||||||
<div slot="header" class="modal-header">
|
<div slot="header" class="modal-header">
|
||||||
<IconConstrain iconSize={90}>
|
<IconConstrain iconSize={90}>
|
||||||
|
|
Loading…
Reference in a new issue