mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix broken tag editor in Svelte 5 (#3488)
* Fix temporary disappearance of a tag https://forums.ankiweb.net/t/anki-24-10-beta/49989/47 * Fix incorrect behavior after tag deletion * Fix tag addition/selection buttons becoming invisible Once tags were selected, subsequent deselection or selection did not mount 'TagAddButton' or 'TagsSelectedButton' components.
This commit is contained in:
parent
931e1d80f2
commit
e79060487b
3 changed files with 13 additions and 7 deletions
|
@ -43,9 +43,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
>
|
||||
<TagDeleteBadge
|
||||
class={hoverClass}
|
||||
on:click={() => {
|
||||
on:click={(evt) => {
|
||||
if (!selectMode) {
|
||||
deleteTag();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
|
|
@ -76,6 +76,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
* Choose as accepted suggestion
|
||||
*/
|
||||
async function chooseSelected() {
|
||||
if (!suggestionsItems.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
active = true;
|
||||
dispatch("choose", { chosen: suggestionsItems[selected ?? -1] });
|
||||
|
||||
|
@ -129,7 +133,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
keepOnKeyup
|
||||
show={$show}
|
||||
preferredPlacement="top"
|
||||
portalTarget={document.body}
|
||||
let:asReference
|
||||
on:close={() => show.set(false)}
|
||||
>
|
||||
|
|
|
@ -17,11 +17,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
bind:offsetHeight={badgeHeight}
|
||||
on:mousedown|preventDefault
|
||||
>
|
||||
{#if tagsSelected}
|
||||
<TagsSelectedButton on:tagselectall on:tagcopy on:tagdelete />
|
||||
{:else}
|
||||
<TagAddButton on:tagappend {keyCombination} />
|
||||
{/if}
|
||||
{#key tagsSelected}
|
||||
{#if tagsSelected}
|
||||
<TagsSelectedButton on:tagselectall on:tagcopy on:tagdelete />
|
||||
{:else}
|
||||
<TagAddButton on:tagappend {keyCombination} />
|
||||
{/if}
|
||||
{/key}
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
Loading…
Reference in a new issue