1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Backport pull request #6413 from jellyfin-web/release-10.10.z

Prevent Focus Loss When Skip Button is Pressed

Original-merge: 4f17cebc02

Merged-by: thornbill <thornbill@users.noreply.github.com>

Backported-by: thornbill <thornbill@users.noreply.github.com>
This commit is contained in:
rlauuzo 2025-01-22 03:12:46 -05:00 committed by thornbill
parent 05cce43ffd
commit 34ace6bc11
3 changed files with 41 additions and 16 deletions

View file

@ -93,22 +93,24 @@ function isCurrentlyFocusableInternal(elem) {
// Determines if a focusable element can be focused at a given point in time
function isCurrentlyFocusable(elem) {
if (elem.disabled) {
return false;
}
if (elem.getAttribute('tabindex') === '-1') {
return false;
}
if (elem.tagName === 'INPUT') {
const type = elem.type;
if (type === 'range') {
if (!elem.classList?.contains('focusable')) {
if (elem.disabled) {
return false;
}
if (type === 'file') {
if (elem.getAttribute('tabindex') === '-1') {
return false;
}
if (elem.tagName === 'INPUT') {
const type = elem.type;
if (type === 'range') {
return false;
}
if (type === 'file') {
return false;
}
}
}
return isCurrentlyFocusableInternal(elem);