🐛 Fix text editor issues

This commit is contained in:
AzazelN28 2024-11-26 11:40:29 +01:00 committed by Andrey Antukh
parent 59e5656bd7
commit 59ca09c24e
3 changed files with 34 additions and 6 deletions

View file

@ -223,7 +223,9 @@ export class TextEditor extends EventTarget {
* @param {FocusEvent} e
*/
#onFocus = (e) => {
this.#selectionController.restoreSelection();
if (!this.#selectionController.restoreSelection()) {
this.selectAll();
}
if (this.#selectionImposterElement) {
this.#selectionImposterElement.replaceChildren();
}