Skip to content

Commit

Permalink
fix: handle Esc in IE compatible way, fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Jul 16, 2019
1 parent b81814e commit f897bea
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Effect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ export function Effect(
if (event.defaultPrevented) {
return;
}
const code = event.key || event.keyCode;
if ((event.code === 'Escape' || code === 'Escape' || code === 27) && onEscapeKey) {
if ((event.code === 'Escape' || event.key === 'Escape' || event.keyCode === 27) && onEscapeKey) {
onEscapeKey(event);
}
};
Expand Down

0 comments on commit f897bea

Please sign in to comment.