Skip to content
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

Draft
wants to merge 3 commits into
base: release-10.10.z
Choose a base branch
from

Conversation

dmitrylyzo
Copy link
Contributor

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?

Delay testing of the focused element and do not replace the
pending element with the pause button until then.
@dmitrylyzo dmitrylyzo added bug Something isn't working stable backport Backport into the next stable release labels Feb 2, 2025
@dmitrylyzo dmitrylyzo added this to the v10.10.6 milestone Feb 2, 2025
@jellyfin-bot
Copy link
Collaborator

jellyfin-bot commented Feb 2, 2025

Cloudflare Pages deployment

Latest commit 54cde6c
Status ✅ Deployed!
Preview URL https://ff975ce1.jellyfin-web.pages.dev
Type 🔀 Preview

View build logs

FocusManager.isCurrentlyFocusableInternal doesn't work with
fixed elements.
Copy link

sonarqubecloud bot commented Feb 3, 2025

Copy link
Contributor

@github-actions github-actions bot left a 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
Copy link
Contributor

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 () {
Copy link
Contributor

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

Comment on lines +406 to +415
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);
};
Copy link
Contributor Author

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? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stable backport Backport into the next stable release
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants