diff --git a/packages/eui/changelogs/upcoming/8140.md b/packages/eui/changelogs/upcoming/8140.md new file mode 100644 index 00000000000..ccd548863f5 --- /dev/null +++ b/packages/eui/changelogs/upcoming/8140.md @@ -0,0 +1,3 @@ +**Accessibility** + +- When the tooltips components (`EuiTooltip`, `EuiIconTip`) are used inside components that handle the Escape key (like `EuiFlyout` or `EuiModal`), pressing the Escape key will now only close the tooltip and not the entire wrapping component. diff --git a/packages/eui/src/components/tool_tip/tool_tip.tsx b/packages/eui/src/components/tool_tip/tool_tip.tsx index 616ca2b5ab0..250d66faaf1 100644 --- a/packages/eui/src/components/tool_tip/tool_tip.tsx +++ b/packages/eui/src/components/tool_tip/tool_tip.tsx @@ -280,6 +280,7 @@ export class EuiToolTip extends Component { onEscapeKey = (event: React.KeyboardEvent) => { if (event.key === keys.ESCAPE) { + event.stopPropagation(); this.setState({ hasFocus: false }); // Allows mousing over back into the tooltip to work correctly this.hideToolTip(); }