Fix Tab not moving caret to end

This commit is contained in:
Henrik Giesel 2021-09-02 18:32:28 +02:00 committed by Damien Elmes
parent 5cf2c6196d
commit add6d86ae6

View file

@ -15,11 +15,7 @@ import { getCurrentField } from "./helpers";
export function onFocus(evt: FocusEvent): void {
const currentField = evt.currentTarget as EditingArea;
currentField.focus();
if (currentField.getSelection().anchorNode === null) {
// selection is not inside editable after focusing
currentField.caretToEnd();
}
currentField.caretToEnd();
bridgeCommand(`focus:${currentField.ord}`);
fieldFocused.set(true);