Closed alexwizp closed 1 month ago
💭 I had a first look at this and I think we could improve EuiModal
generically by checking the event target. We're using portals for EuiPopover
, meaning that the target for a popover would not be inside the Modal.
Both EuiModal
and EuiPopover
already have stopPropagation
applied and my hunch is that the issue lies around the portal and focus trap contexts.
For this first look, I checked it against some similar components (EuiSelectable, EuiSelect, EuiSuperSelect, EuiCombobox) so far, but I think this could be a rather light weight alternative to check deeper.
https://github.com/elastic/eui/assets/44670957/c519fbbb-7048-4871-967c-0f33db640eaa
Describe the problem
Pressing the
ESC
key within a child component nested inside anEuiPopover
unexpectedly closes the parentEuiModal
.Steps to Reproduce:
EuiModal
component.EuiPopover
component within theEuiModal
.EuiPopover
component.Expected Result:
EuiModal
should remain open.Actual Result:
Pressing the ESC key closes the parent
EuiModal
.Additional Information:
Test code:
Related to: https://github.com/elastic/observability-accessibility/issues/31.