diff --git a/src/OptionList.tsx b/src/OptionList.tsx index d2f7738ab..bfc2a9f9c 100644 --- a/src/OptionList.tsx +++ b/src/OptionList.tsx @@ -218,6 +218,9 @@ const OptionList: React.RefForwardingComponent< // >>> Close case KeyCode.ESC: { onToggleOpen(false); + if (open) { + event.stopPropagation(); + } } } }, diff --git a/tests/Select.test.tsx b/tests/Select.test.tsx index 99a20bb84..961d39aaf 100644 --- a/tests/Select.test.tsx +++ b/tests/Select.test.tsx @@ -666,7 +666,12 @@ describe('Select.Basic', () => { }); it('close on ESC', () => { - const wrapper = mount(); + const onKeyDown = jest.fn(); + const wrapper = mount( +