From 73dbd905d599381fcd585c9db8a83d8ac295a825 Mon Sep 17 00:00:00 2001 From: mister-ben <1676039+mister-ben@users.noreply.github.com> Date: Thu, 15 Aug 2024 09:09:33 +0200 Subject: [PATCH] fix: check for closeable() before calling in spatialnavigation --- src/js/spatial-navigation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/spatial-navigation.js b/src/js/spatial-navigation.js index dacb5e75a1..0eb627f890 100644 --- a/src/js/spatial-navigation.js +++ b/src/js/spatial-navigation.js @@ -118,7 +118,8 @@ class SpatialNavigation extends EventTarget { const action = SpatialNavKeyCodes.getEventName(actualEvent); 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(); event.target.close(); }