Skip to content

Commit

Permalink
allow scan input text when tapping on same position
Browse files Browse the repository at this point in the history
  • Loading branch information
khaitruong922 committed Sep 25, 2024
1 parent ba8cd7c commit e2d050c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ext/js/language/text-scanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,12 @@ export class TextScanner extends EventDispatcher {
if (isAltText) {
return;
}
const {imposterSourceElement} = textSource;
const {imposterSourceElement, rangeStartOffset} = textSource;
if (imposterSourceElement instanceof HTMLTextAreaElement || imposterSourceElement instanceof HTMLInputElement) {
return;
const isFocused = imposterSourceElement === document.activeElement;
if (!isFocused || imposterSourceElement.selectionStart !== rangeStartOffset) {
return;
}
}
}

Expand Down

0 comments on commit e2d050c

Please sign in to comment.