Skip to content

Commit

Permalink
[!!!] EuiContextMenuPanels with children are still broken and do no…
Browse files Browse the repository at this point in the history
…t correctly return focus :(

- this is because of `shouldComponentUpdate` - the `items` API updates focus less than `children`, so `children` is still updating/hijacking focus after the popover focus trap returns focus to the button
  • Loading branch information
cee-chen committed May 5, 2022
1 parent f6c99b8 commit 6ef9342
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/components/context_menu/context_menu_panel.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,12 @@ describe('EuiContextMenuPanel', () => {
}
{...rest}
>
<EuiContextMenuPanel
items={[
children || (
<button onClick={closePopover}>
Closes popover from context menu
</button>
),
]}
/>
<EuiContextMenuPanel>
{children}
<button onClick={closePopover}>
Closes popover from context menu
</button>
</EuiContextMenuPanel>
</EuiPopover>
);
};
Expand Down

0 comments on commit 6ef9342

Please sign in to comment.