-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix re-focusing on pause button when displaying OSD #6510
base: release-10.10.z
Are you sure you want to change the base?
Conversation
Delay testing of the focused element and do not replace the pending element with the pause button until then.
Cloudflare Pages deployment
|
FocusManager.isCurrentlyFocusableInternal doesn't work with fixed elements.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESLint doesn't pass. Please fix all ESLint issues.
@@ -49,7 +49,8 @@ class SkipSegment extends PlaybackSubscriber { | |||
if (!this.skipElement && this.currentSegment) { | |||
let buttonHtml = ''; | |||
|
|||
buttonHtml += '<button is="emby-button" class="skip-button hide skip-button-hidden"></button>'; | |||
// FIXME: Move skip button to the video OSD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected 'fixme' comment: 'FIXME: Move skip button to the video OSD'. no-warning-comments
|
||
return debounced; | ||
}();*/ | ||
const _focus = function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'_focus' is assigned a value but never used. no-unused-vars
const _focus2 = function (focusElement) { | ||
// If no focus element is provided, try to keep current focus if it's valid, | ||
// otherwise default to pause button | ||
const currentFocus = focusElement || document.activeElement; | ||
if (!currentFocus || !focusManager.isCurrentlyFocusable(currentFocus)) { | ||
focusElement = osdBottomElement.querySelector('.btnPause'); | ||
} | ||
|
||
if (focusElement) focusManager.focus(focusElement); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, do we need to debounce/timeout focus at all? _focus2
seems to work in webOS 1.2, webOS 5, Firefox 134, Chrome 132.
Maybe timeout was for Internet Explorer? 🤔
Changes
Delay testing of the focused element and do not replace the pending element with the pause button until then.
Issues
Fixes jellyfin/jellyfin-tizen#331
I made 2 versions: with
lodash/debounce
and without it. Which one do you prefer?