1
0
mirror of https://github.com/videojs/video.js.git synced 2025-02-04 11:43:27 +02:00

fix: keep focus trapping contained to modal (#6983)

This commit is contained in:
Claire Kannapell 2022-02-23 11:16:28 -06:00 committed by GitHub
parent 53cbfc6222
commit 950deae59b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ import mergeOptions from './utils/merge-options.js';
import computedStyle from './utils/computed-style';
import Map from './utils/map.js';
import Set from './utils/set.js';
import keycode from 'keycode';
/**
* Base class for all UI Components.
@ -1161,8 +1162,10 @@ class Component {
if (this.player_) {
// We only stop propagation here because we want unhandled events to fall
// back to the browser.
// back to the browser. Exclude Tab for focus trapping.
if (!keycode.isEventKey(event, 'Tab')) {
event.stopPropagation();
}
this.player_.handleKeyDown(event);
}
}