mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
Improve behavior when moving towards newInput
This commit is contained in:
parent
796c759333
commit
15ef6d51b3
1 changed files with 8 additions and 4 deletions
|
@ -68,7 +68,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteTagAt(index: number): void {
|
function deleteTagAt(index: number): void {
|
||||||
console.log("eyo", index);
|
|
||||||
tags.splice(index, 1);
|
tags.splice(index, 1);
|
||||||
tags = tags;
|
tags = tags;
|
||||||
}
|
}
|
||||||
|
@ -104,9 +103,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
}
|
}
|
||||||
|
|
||||||
async function moveToNextTag(index: number): Promise<void> {
|
async function moveToNextTag(index: number): Promise<void> {
|
||||||
if (index === tags.length - 1 || tags.length === 1) {
|
if (index === tags.length - 2) {
|
||||||
focusNewInput();
|
|
||||||
return;
|
return;
|
||||||
|
// TODO
|
||||||
|
} else if (index === tags.length - 1) {
|
||||||
|
tags[index].active = false;
|
||||||
|
tags = tags;
|
||||||
|
|
||||||
|
await tick();
|
||||||
|
focusNewInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
tags[index].active = false;
|
tags[index].active = false;
|
||||||
|
@ -114,7 +119,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
tags = tags;
|
tags = tags;
|
||||||
|
|
||||||
await tick();
|
await tick();
|
||||||
|
|
||||||
(document.activeElement as HTMLInputElement).setSelectionRange(0, 0);
|
(document.activeElement as HTMLInputElement).setSelectionRange(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue