Closed bxiao closed 2 years ago
Thanks for opening your first issue! :wave: If you have found this library helpful, please star it. A maintainer will try to respond within 7 days. If you haven’t heard anything by then, please bump this thread.
This line may help also. In the Combobox PR fix, this is what stops the event from bubbling https://github.com/salesforce/design-system-react/blob/master/utilities/key-callbacks.js#L16
if (stopPropagation) {
EventUtil.trapEvent(event);
}
So something like this should do it in https://github.com/salesforce/design-system-react/blob/master/utilities/keyboard-navigable-dialog.js#L46
case KEYS.ESCAPE:
if (isOpen) {
toggleOpen();
EventUtil.trapEvent(event);
}
break;
When a Popover component is used inside a Modal component and if the popover is open, pressing the Escape key closes both the popover and the modal.
Expected behavior: Pressing Escape key when the popover is open should only close the popover. Modal should remain open.