mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
fix changes to tags not being reflected when editing in io mode (#3768)
This commit is contained in:
parent
71e2a6f782
commit
df808727c8
1 changed files with 7 additions and 0 deletions
|
@ -277,8 +277,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
hidden: hideFieldInOcclusionType(index, ioFields),
|
hidden: hideFieldInOcclusionType(index, ioFields),
|
||||||
})) as FieldData[];
|
})) as FieldData[];
|
||||||
|
|
||||||
|
let lastSavedTags: string[] | null = null;
|
||||||
function saveTags({ detail }: CustomEvent): void {
|
function saveTags({ detail }: CustomEvent): void {
|
||||||
tagAmount = detail.tags.filter((tag: string) => tag != "").length;
|
tagAmount = detail.tags.filter((tag: string) => tag != "").length;
|
||||||
|
lastSavedTags = detail.tags;
|
||||||
bridgeCommand(`saveTags:${JSON.stringify(detail.tags)}`);
|
bridgeCommand(`saveTags:${JSON.stringify(detail.tags)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,6 +537,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
imageOcclusionMode,
|
imageOcclusionMode,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$: if (isImageOcclusion && $ioMaskEditorVisible && lastSavedTags) {
|
||||||
|
setTags(lastSavedTags);
|
||||||
|
lastSavedTags = null;
|
||||||
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
function wrap(before: string, after: string): void {
|
function wrap(before: string, after: string): void {
|
||||||
if (!$focusedInput || !editingInputIsRichText($focusedInput)) {
|
if (!$focusedInput || !editingInputIsRichText($focusedInput)) {
|
||||||
|
|
Loading…
Reference in a new issue