diff --git a/packages/design-system/src/components/primitives/arrow-focus.tsx b/packages/design-system/src/components/primitives/arrow-focus.tsx index 03d821991115..7cb6da540448 100644 --- a/packages/design-system/src/components/primitives/arrow-focus.tsx +++ b/packages/design-system/src/components/primitives/arrow-focus.tsx @@ -61,6 +61,19 @@ const ContextHelper = ({ render }: { render: Render }) => { event: KeyboardEvent, focusManagerOptions?: FocusManagerOptions ) => { + if (event.defaultPrevented) { + return; + } + + if ( + event.target instanceof Element && + false === event.currentTarget.contains(event.target) + ) { + // Event occurs inside a portal, typically within a popover or dialog, but the handler is outside the popover/dialog. + // Ignore these events as they do not affect focus outside the dialog. + return; + } + if (willEventMoveCaret(event)) { return; }