1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-04 06:48:49 +02:00

fix: always set tabIndex to restore keydown a11y (#6871)

Skipping the tabIndex property on created elements due to #6145
optimizations blocks them from receiving keyboard events, due to not
being focusable; for example this breaks closing ModalDialog elements by
pressing Escape.
Fix this by always setting tabIndex, as the element may return the same
value even though the property has not been explicitly set.

Fixes #6870
This commit is contained in:
Zenon Mousmoulas 2020-11-11 01:10:59 +02:00 committed by GitHub
parent 861753017e
commit 0140b28cc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,7 +165,7 @@ export function createEl(tagName = 'div', properties = {}, attributes = {}, cont
// method for it.
} else if (propName === 'textContent') {
textContent(el, val);
} else if (el[propName] !== val) {
} else if (el[propName] !== val || propName === 'tabIndex') {
el[propName] = val;
}
});