diff --git a/packages/components/src/navigable-container/container.tsx b/packages/components/src/navigable-container/container.tsx index c203354c3e123..f52754e06d61a 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; }