From 6ba06782742f7c12571039c5dbc8989cc6e23074 Mon Sep 17 00:00:00 2001 From: Eli Luberoff Date: Wed, 18 Sep 2024 16:58:58 -0400 Subject: [PATCH] truly clear selection the way I built this, selection was sticking around but "cleared". Instead, we should clear it, which also makes sure that the API method getSelection() returns nothing in this situtation as well. --- src/services/focusBlur.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/focusBlur.ts b/src/services/focusBlur.ts index 4d75ae5c2..fa4322845 100644 --- a/src/services/focusBlur.ts +++ b/src/services/focusBlur.ts @@ -71,14 +71,14 @@ class Controller_focusBlur extends Controller_exportText { }; private handleTextareaFocusStatic = () => { - if (!this.cursor.selection || this.cursor.selection.isCleared()) { + if (!this.cursor.selection) { this.cursor.controller.selectAll(); } this.blurred = false; }; private handleTextareaBlurStatic = () => { - this.cursor.selection?.clear(); + this.cursor.clearSelection(); }; private handleWindowBlur = () => {