Don't clear the selection before the text scanner has been enabled (#2006)
This commit is contained in:
parent
657292733d
commit
70ac6c51f9
@ -83,6 +83,7 @@ class Frontend {
|
|||||||
searchTerms: true,
|
searchTerms: true,
|
||||||
searchKanji: true
|
searchKanji: true
|
||||||
});
|
});
|
||||||
|
this._textScannerHasBeenEnabled = false;
|
||||||
this._popupCache = new Map();
|
this._popupCache = new Map();
|
||||||
this._popupEventListeners = new EventListenerCollection();
|
this._popupEventListeners = new EventListenerCollection();
|
||||||
this._updatePopupToken = null;
|
this._updatePopupToken = null;
|
||||||
@ -620,8 +621,13 @@ class Frontend {
|
|||||||
const enabled = (this._options !== null && this._options.general.enable && !this._disabledOverride);
|
const enabled = (this._options !== null && this._options.general.enable && !this._disabledOverride);
|
||||||
if (enabled === this._textScanner.isEnabled()) { return; }
|
if (enabled === this._textScanner.isEnabled()) { return; }
|
||||||
this._textScanner.setEnabled(enabled);
|
this._textScanner.setEnabled(enabled);
|
||||||
|
if (this._textScannerHasBeenEnabled) {
|
||||||
this._clearSelection(true);
|
this._clearSelection(true);
|
||||||
}
|
}
|
||||||
|
if (enabled) {
|
||||||
|
this._textScannerHasBeenEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_updateContentScale() {
|
_updateContentScale() {
|
||||||
const {popupScalingFactor, popupScaleRelativeToPageZoom, popupScaleRelativeToVisualViewport} = this._options.general;
|
const {popupScalingFactor, popupScaleRelativeToPageZoom, popupScaleRelativeToVisualViewport} = this._options.general;
|
||||||
|
Loading…
Reference in New Issue
Block a user