mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57:19 +02:00
Fix not able to scroll pass hidden settings
This commit is contained in:
parent
a268e49280
commit
1d590103ce
@ -529,14 +529,18 @@ export class StreamSettings {
|
|||||||
const $childSetting = $sibling.querySelector('[tabindex="0"]:last-of-type') as HTMLElement;
|
const $childSetting = $sibling.querySelector('[tabindex="0"]:last-of-type') as HTMLElement;
|
||||||
if ($childSetting) {
|
if ($childSetting) {
|
||||||
$childSetting.focus();
|
$childSetting.focus();
|
||||||
return;
|
|
||||||
|
// Only stop when it was focused successfully
|
||||||
|
if (document.activeElement === $childSetting) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If it's the first/last item -> loop around
|
// If it's the first/last item -> loop around
|
||||||
// TODO: bugged if pseudo is "first-of-type" and the first setting is disabled
|
// TODO: bugged if pseudo is "first-of-type" and the first setting is disabled
|
||||||
const pseudo = direction === NavigationDirection.UP ? ':last-of-type' : '';
|
const pseudo = direction === NavigationDirection.UP ? ':last-of-type' : '';
|
||||||
const $target = this.$settings!.querySelector(`div[data-tab-group]:not(.bx-gone) div[data-focus-container]${pseudo} [tabindex="0"]:not(:disabled):last-of-type`);
|
const $target = this.$settings!.querySelector(`div[data-tab-group]:not(.bx-gone) div[data-focus-container]:not(.bx-gone)${pseudo} [tabindex="0"]:not(:disabled):last-of-type`);
|
||||||
$target && ($target as HTMLElement).focus();
|
$target && ($target as HTMLElement).focus();
|
||||||
} else if (direction === NavigationDirection.LEFT || direction === NavigationDirection.RIGHT) {
|
} else if (direction === NavigationDirection.LEFT || direction === NavigationDirection.RIGHT) {
|
||||||
// Find all child elements with tabindex
|
// Find all child elements with tabindex
|
||||||
|
Loading…
x
Reference in New Issue
Block a user