mirror of
https://github.com/videojs/video.js.git
synced 2025-01-02 06:32:07 +02:00
fix: check for closeable() before calling in spatialnavigation (#8832)
## Description Passing the back key causes an error in spatial navigation if the event target does not have a `closeable` function. ## Specific Changes proposed Add a check before calling.
This commit is contained in:
parent
5fac9e1e9d
commit
8c56e31cad
@ -120,7 +120,8 @@ class SpatialNavigation extends EventTarget {
|
|||||||
const action = SpatialNavKeyCodes.getEventName(actualEvent);
|
const action = SpatialNavKeyCodes.getEventName(actualEvent);
|
||||||
|
|
||||||
this.performMediaAction_(action);
|
this.performMediaAction_(action);
|
||||||
} else if (SpatialNavKeyCodes.isEventKey(actualEvent, 'Back') && event.target && event.target.closeable()) {
|
} else if (SpatialNavKeyCodes.isEventKey(actualEvent, 'Back') &&
|
||||||
|
event.target && typeof event.target.closeable === 'function' && event.target.closeable()) {
|
||||||
actualEvent.preventDefault();
|
actualEvent.preventDefault();
|
||||||
event.target.close();
|
event.target.close();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user