focus fixes

This commit is contained in:
Jan Prochazka 2021-10-14 08:17:50 +02:00
parent e3aa4d54ef
commit 1bfa004e65
3 changed files with 6 additions and 1 deletions

View File

@ -365,7 +365,7 @@
});
const text = lines.join('\r\n');
copyTextToClipboard(text);
if (domFocusField) domFocusField.focus();
// if (domFocusField) domFocusField.focus();
}
export function loadNextDataIfNeeded() {

View File

@ -204,6 +204,7 @@
onInsert: text => {
const editor = domEditor.getEditor();
editor.session.insert(editor.getCursorPosition(), text);
domEditor?.getEditor()?.focus();
},
});
}

View File

@ -1,4 +1,6 @@
export function copyTextToClipboard(text) {
const oldFocus = document.activeElement;
const textArea = document.createElement('textarea');
//
@ -53,4 +55,6 @@ export function copyTextToClipboard(text) {
}
document.body.removeChild(textArea);
if (oldFocus) oldFocus.focus();
}