WebUI: use passive event handlers

These kind of event handlers can be asynchronously dispatched, freeing up the main thread for
lag-free operation.
This commit is contained in:
Chocobo1 2024-08-10 01:33:13 +08:00
parent 29379232aa
commit 98623b2cf7
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
2 changed files with 4 additions and 4 deletions

View file

@ -274,7 +274,7 @@ window.qBittorrent.DynamicTable ??= (() => {
const th = ths[i];
th.addEventListener("mousemove", mouseMoveFn);
th.addEventListener("mouseout", mouseOutFn);
th.addEventListener("touchend", onTouch);
th.addEventListener("touchend", onTouch, { passive: true });
th.makeResizable({
modifiers: {
x: "",
@ -762,7 +762,7 @@ window.qBittorrent.DynamicTable ??= (() => {
this._this.deselectAll();
this._this.selectRow(this.rowId);
}
});
}, { passive: true });
tr.addEventListener("keydown", function(event) {
switch (event.key) {
case "up":