Merge pull request #1675 from Laerdal/focus-trap-only-fullscreen
Trap keyboard focus only when fullscreen
This commit is contained in:
commit
f00c279366
@ -257,10 +257,11 @@ export function trapFocus(element = null, toggle = false) {
|
||||
const focusable = getElements.call(this, 'button:not(:disabled), input:not(:disabled), [tabindex]');
|
||||
const first = focusable[0];
|
||||
const last = focusable[focusable.length - 1];
|
||||
const player = this;
|
||||
|
||||
const trap = event => {
|
||||
// Bail if not tab key or not fullscreen
|
||||
if (event.key !== 'Tab' || event.keyCode !== 9) {
|
||||
if (event.key !== 'Tab' || event.keyCode !== 9 || !player.fullscreen.active) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user