Closed coffeedawg closed 5 years ago
The following code doesn't work in IE:
var code = event.key || event.keyCode; if ((event.code === 'Escape' || code === 'Escape' || code === 27) && _this.props.onEscapeKey) { _this.props.onEscapeKey(event); }
it should be:
if ((event.code === 'Escape' || event.key === 'Escape' || event.keyCode === 27) && _this.props.onEscapeKey) { _this.props.onEscapeKey(event); }
IE11 sets event.key to "Esc" so the keyCode is skipped and thereby ignored.
event.key
"Esc"
keyCode
It seems to work correctly in Edge 18.
Sounds correct 👍
v3.0.5
The following code doesn't work in IE:
it should be:
IE11 sets
event.key
to"Esc"
so thekeyCode
is skipped and thereby ignored.It seems to work correctly in Edge 18.