mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 20:57:13 -05:00
Fix Tab not moving caret to end
This commit is contained in:
parent
5cf2c6196d
commit
add6d86ae6
1 changed files with 1 additions and 5 deletions
|
|
@ -15,11 +15,7 @@ import { getCurrentField } from "./helpers";
|
||||||
export function onFocus(evt: FocusEvent): void {
|
export function onFocus(evt: FocusEvent): void {
|
||||||
const currentField = evt.currentTarget as EditingArea;
|
const currentField = evt.currentTarget as EditingArea;
|
||||||
currentField.focus();
|
currentField.focus();
|
||||||
|
|
||||||
if (currentField.getSelection().anchorNode === null) {
|
|
||||||
// selection is not inside editable after focusing
|
|
||||||
currentField.caretToEnd();
|
currentField.caretToEnd();
|
||||||
}
|
|
||||||
|
|
||||||
bridgeCommand(`focus:${currentField.ord}`);
|
bridgeCommand(`focus:${currentField.ord}`);
|
||||||
fieldFocused.set(true);
|
fieldFocused.set(true);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue