Skip to content

Commit

Permalink
Apply preventNextMouseDown for touch end to prevent instantly closing…
Browse files Browse the repository at this point in the history
… popup (#1777)

Apply preventNextMouseDown to searchAtFromTouchEnd
Kuuuube authored Jan 27, 2025
1 parent c3bec65 commit fda354b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/js/language/text-scanner.js
Original file line number Diff line number Diff line change
@@ -1349,7 +1349,16 @@ export class TextScanner extends EventDispatcher {
* @param {import('text-scanner').InputInfo} inputInfo
*/
async _searchAtFromTouchEnd(x, y, inputInfo) {
const textSourceCurrentPrevious = this._textSourceCurrent !== null ? this._textSourceCurrent.clone() : null;

await this._searchAt(x, y, inputInfo);

if (
this._textSourceCurrent !== null &&
!(textSourceCurrentPrevious !== null && this._textSourceCurrent.hasSameStart(textSourceCurrentPrevious))
) {
this._preventNextMouseDown = true;
}
}

/**

0 comments on commit fda354b

Please sign in to comment.