diff --git a/packages/emoji-mart/src/components/Navigation/Navigation.tsx b/packages/emoji-mart/src/components/Navigation/Navigation.tsx index 5287ab4d..194432be 100644 --- a/packages/emoji-mart/src/components/Navigation/Navigation.tsx +++ b/packages/emoji-mart/src/components/Navigation/Navigation.tsx @@ -24,7 +24,10 @@ export default class Navigation extends PureComponent { } handleKeyDown = (e: KeyboardEvent) => { - e.stopImmediatePropagation() + // Escape should still propagate up since it can be used in a dialog + if (e.key !== 'Escape') { + e.stopImmediatePropagation() + } switch (e.key) { case 'ArrowLeft': diff --git a/packages/emoji-mart/src/components/Picker/Picker.tsx b/packages/emoji-mart/src/components/Picker/Picker.tsx index 8f33f809..84414d57 100644 --- a/packages/emoji-mart/src/components/Picker/Picker.tsx +++ b/packages/emoji-mart/src/components/Picker/Picker.tsx @@ -406,10 +406,14 @@ export default class Picker extends Component { this.setState({ searchResults: grid, pos }, afterRender) } - handleEmojisKeyDown = (e) => { + handleEmojisKeyDown = (e: KeyboardEvent) => { // const specialKey = e.altKey || e.ctrlKey || e.metaKey const input = this.refs.searchInput.current - e.stopImmediatePropagation() + + // Escape should still propagate up since it can be used in a dialog + if (e.key !== 'Escape') { + e.stopImmediatePropagation() + } switch (e.key) { case 'ArrowLeft':