mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Fix bugs in NumberStepper
This commit is contained in:
parent
4217b89194
commit
b170b95145
@ -239,7 +239,7 @@ export class NavigationDialogManager {
|
||||
} else if (keyCode === 'Enter' || keyCode === 'NumpadEnter' || keyCode === 'Space') {
|
||||
if (!($target instanceof HTMLInputElement && $target.type === 'text')) {
|
||||
handled = true;
|
||||
$target.dispatchEvent(new MouseEvent('click'));
|
||||
$target.dispatchEvent(new MouseEvent('click', {bubbles: true}));
|
||||
}
|
||||
} else if (keyCode === 'Escape') {
|
||||
handled = true;
|
||||
@ -366,7 +366,7 @@ export class NavigationDialogManager {
|
||||
}
|
||||
|
||||
if (releasedButton === GamepadKey.A) {
|
||||
document.activeElement && document.activeElement.dispatchEvent(new MouseEvent('click'));
|
||||
document.activeElement && document.activeElement.dispatchEvent(new MouseEvent('click', {bubbles: true}));
|
||||
return;
|
||||
} else if (releasedButton === GamepadKey.B) {
|
||||
this.hide();
|
||||
|
@ -168,7 +168,6 @@ export class SettingElement {
|
||||
let isHolding = false;
|
||||
|
||||
const clearIntervalId = () => {
|
||||
console.log('clearIntervalId');
|
||||
intervalId && clearInterval(intervalId);
|
||||
intervalId = null;
|
||||
}
|
||||
@ -287,7 +286,6 @@ export class SettingElement {
|
||||
updateButtonsVisibility();
|
||||
|
||||
const buttonPressed = (e: Event, $btn: HTMLElement) => {
|
||||
console.log('changeValue');
|
||||
let value = parseInt(controlValue);
|
||||
|
||||
const btnType = $btn.dataset.type;
|
||||
@ -312,7 +310,6 @@ export class SettingElement {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('click');
|
||||
const $btn = (e.target as HTMLElement).closest('button') as HTMLElement;
|
||||
$btn && buttonPressed(e, $btn);
|
||||
|
||||
@ -321,7 +318,6 @@ export class SettingElement {
|
||||
};
|
||||
|
||||
const onPointerDown = (e: PointerEvent) => {
|
||||
console.log('down');
|
||||
clearIntervalId();
|
||||
|
||||
const $btn = (e.target as HTMLElement).closest('button') as HTMLElement;
|
||||
@ -357,7 +353,7 @@ export class SettingElement {
|
||||
$wrapper.addEventListener('pointerdown', onPointerDown);
|
||||
$wrapper.addEventListener('contextmenu', onContextMenu);
|
||||
setNearby($wrapper, {
|
||||
focus: $range || $btnInc,
|
||||
focus: options.hideSlider ? $btnInc : $range,
|
||||
})
|
||||
|
||||
return $wrapper;
|
||||
|
Loading…
x
Reference in New Issue
Block a user