mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 15:47:18 +02:00
Fix the stats selection box not working on mobile
This commit is contained in:
parent
2a85dd574e
commit
2a71e17d2d
@ -1496,19 +1496,21 @@ class Preferences {
|
||||
const $option = CE('option', {value: value}, label);
|
||||
$option.selected = currentValue.indexOf(value) > -1;
|
||||
|
||||
$option.addEventListener('mousedown', function(e) {
|
||||
e.preventDefault();
|
||||
e.target.selected = !e.target.selected;
|
||||
|
||||
const $parent = e.target.parentElement;
|
||||
$parent.focus();
|
||||
$parent.dispatchEvent(new Event('change'));
|
||||
});
|
||||
|
||||
$control.appendChild($option);
|
||||
}
|
||||
|
||||
$control.addEventListener('mousedown', function(e) {
|
||||
e.preventDefault();
|
||||
$control.addEventListener('mousedown', e => {
|
||||
const $this = this;
|
||||
const orgScrollTop = $this.scrollTop;
|
||||
e.target.selected = !e.target.selected;
|
||||
|
||||
const $parent = e.target.parentElement;
|
||||
$parent.focus();
|
||||
$parent.dispatchEvent(new Event('change'));
|
||||
|
||||
setTimeout(() => ($this.scrollTop = orgScrollTop), 0);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user