aboutsummaryrefslogtreecommitdiff
path: root/ext/js/app
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-11-13 11:11:33 -0500
committerGitHub <noreply@github.com>2021-11-13 11:11:33 -0500
commit70ac6c51f99ba055ebced0dc3ab2be1b00d95992 (patch)
tree549b98f542f80ffc96fb6efb9a29d3bc3fa63434 /ext/js/app
parent657292733dce557d2c71c2d5b336751b590b1828 (diff)
Don't clear the selection before the text scanner has been enabled (#2006)
Diffstat (limited to 'ext/js/app')
-rw-r--r--ext/js/app/frontend.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js
index 9fa6009b..0f72e06b 100644
--- a/ext/js/app/frontend.js
+++ b/ext/js/app/frontend.js
@@ -83,6 +83,7 @@ class Frontend {
searchTerms: true,
searchKanji: true
});
+ this._textScannerHasBeenEnabled = false;
this._popupCache = new Map();
this._popupEventListeners = new EventListenerCollection();
this._updatePopupToken = null;
@@ -620,7 +621,12 @@ class Frontend {
const enabled = (this._options !== null && this._options.general.enable && !this._disabledOverride);
if (enabled === this._textScanner.isEnabled()) { return; }
this._textScanner.setEnabled(enabled);
- this._clearSelection(true);
+ if (this._textScannerHasBeenEnabled) {
+ this._clearSelection(true);
+ }
+ if (enabled) {
+ this._textScannerHasBeenEnabled = true;
+ }
}
_updateContentScale() {