From bff2e4b26e93e0f89f1c118a722c173c8a50b6e3 Mon Sep 17 00:00:00 2001 From: Ryan Kienstra Date: Sat, 15 Apr 2023 16:47:26 -0600 Subject: [PATCH] Commit Marco's suggestion: Update packages/components/src/navigable-container/container.tsx Co-authored-by: Marco Ciampini --- packages/components/src/navigable-container/container.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/src/navigable-container/container.tsx b/packages/components/src/navigable-container/container.tsx index c203354c3e123e..f52754e06d61ab 100644 --- a/packages/components/src/navigable-container/container.tsx +++ b/packages/components/src/navigable-container/container.tsx @@ -135,7 +135,8 @@ class NavigableContainer extends Component< NavigableContainerProps > { return; } - const { activeElement } = ( event.target as HTMLElement ).ownerDocument; + const activeElement = ( event.target as HTMLElement | null ) + ?.ownerDocument?.activeElement; if ( ! activeElement ) { return; }