-
-
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
Prevent Focus Loss When Skip Button is Pressed #6413
base: release-10.10.z
Are you sure you want to change the base?
Changes from all commits
9e6ee42
c9f6ac5
dcde7c3
b7974c2
2a6c7eb
754d14f
cf72fbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -304,11 +304,15 @@ export default function (view) { | |||
} | ||||
|
||||
function slideDownToShow(elem) { | ||||
clearHideAnimationEventListeners(elem); | ||||
elem.classList.remove('hide'); | ||||
dmitrylyzo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
elem.classList.remove('osdHeader-hidden'); | ||||
} | ||||
|
||||
function slideUpToHide(elem) { | ||||
clearHideAnimationEventListeners(elem); | ||||
elem.classList.add('osdHeader-hidden'); | ||||
dmitrylyzo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
elem.addEventListener(transitionEndEventName, onHideAnimationComplete); | ||||
} | ||||
|
||||
function clearHideAnimationEventListeners(elem) { | ||||
|
@@ -317,7 +321,7 @@ export default function (view) { | |||
|
||||
function onHideAnimationComplete(e) { | ||||
const elem = e.target; | ||||
if (elem != osdBottomElement) return; | ||||
if (elem !== osdBottomElement && elem !== headerElement) return; | ||||
elem.classList.add('hide'); | ||||
elem.removeEventListener(transitionEndEventName, onHideAnimationComplete); | ||||
} | ||||
|
@@ -338,8 +342,17 @@ export default function (view) { | |||
_focus(focusElement); | ||||
} | ||||
toggleSubtitleSync(); | ||||
} else if (currentVisibleMenu === 'osd' && focusElement && !layoutManager.mobile) { | ||||
_focus(focusElement); | ||||
} else if (currentVisibleMenu === 'osd' && !layoutManager.mobile) { | ||||
// If no focus element is provided, try to keep current focus if it's valid, | ||||
// otherwise default to pause button | ||||
if (!focusElement) { | ||||
const currentFocus = document.activeElement; | ||||
if (!currentFocus || !focusManager.isCurrentlyFocusable(currentFocus)) { | ||||
focusElement = osdBottomElement.querySelector('.btnPause'); | ||||
} | ||||
} | ||||
|
||||
if (focusElement) _focus(focusElement); | ||||
} | ||||
} | ||||
|
||||
|
@@ -354,7 +367,8 @@ export default function (view) { | |||
toggleSubtitleSync('hide'); | ||||
|
||||
// Firefox does not blur by itself | ||||
if (document.activeElement) { | ||||
if (osdBottomElement.contains(document.activeElement) | ||||
|| headerElement.contains(document.activeElement)) { | ||||
Comment on lines
+370
to
+371
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just remembered about
We could also just revert the blurring to But since, as I said, it (blur) is probably unnecessary now, we can leave it as is (for now) and remove it completely later. For the record, this is reproducible in Firefox 72. We don't have to support such an old Firefox because it can/should be updated unlike the web engine in TV. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another thing: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, this is a problem with current navigation in general: we don't have a "navmap", the focus manager moves along horizontal and vertical "lanes". We could probably search for the nearest element within the container crossed by the lane. Obviously not for this PR. It would also be better to take into account how the navigation will be implemented in React. |
||||
document.activeElement.blur(); | ||||
} | ||||
} | ||||
|
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.
This should be considered as a temporary solution. We need to move the skip button to the video OSD (maybe in 10.11).