Add a small delay before processing the key input of search boxes

PR #20465.
Closes #20025.
Closes #20235.
This commit is contained in:
Chocobo1 2024-02-27 12:57:55 +08:00 committed by GitHub
parent 46e8ee50c8
commit 15697f904d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 87 additions and 50 deletions

View file

@ -175,12 +175,14 @@ window.qBittorrent.ContextMenu = (function() {
const touchstartEvent = e;
this.touchstartTimer = setTimeout(function() {
this.touchstartTimer = -1;
this.triggerMenu(touchstartEvent, elem);
}.bind(this), this.options.touchTimer);
}.bind(this));
elem.addEvent('touchend', function(e) {
e.preventDefault();
clearTimeout(this.touchstartTimer);
this.touchstartTimer = -1;
}.bind(this));
},