mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -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
|
<TagDeleteBadge
|
||||||
class={hoverClass}
|
class={hoverClass}
|
||||||
on:click={() => {
|
on:click={(evt) => {
|
||||||
if (!selectMode) {
|
if (!selectMode) {
|
||||||
deleteTag();
|
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
|
* Choose as accepted suggestion
|
||||||
*/
|
*/
|
||||||
async function chooseSelected() {
|
async function chooseSelected() {
|
||||||
|
if (!suggestionsItems.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
active = true;
|
active = true;
|
||||||
dispatch("choose", { chosen: suggestionsItems[selected ?? -1] });
|
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
|
keepOnKeyup
|
||||||
show={$show}
|
show={$show}
|
||||||
preferredPlacement="top"
|
preferredPlacement="top"
|
||||||
portalTarget={document.body}
|
|
||||||
let:asReference
|
let:asReference
|
||||||
on:close={() => show.set(false)}
|
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}
|
bind:offsetHeight={badgeHeight}
|
||||||
on:mousedown|preventDefault
|
on:mousedown|preventDefault
|
||||||
>
|
>
|
||||||
{#if tagsSelected}
|
{#key tagsSelected}
|
||||||
<TagsSelectedButton on:tagselectall on:tagcopy on:tagdelete />
|
{#if tagsSelected}
|
||||||
{:else}
|
<TagsSelectedButton on:tagselectall on:tagcopy on:tagdelete />
|
||||||
<TagAddButton on:tagappend {keyCombination} />
|
{:else}
|
||||||
{/if}
|
<TagAddButton on:tagappend {keyCombination} />
|
||||||
|
{/if}
|
||||||
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
Loading…
Reference in a new issue