Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onEscapeKey handler doesn't work with IE11 or some versions of Edge #10

Closed
coffeedawg opened this issue Jul 9, 2019 · 2 comments
Closed
Assignees

Comments

@coffeedawg
Copy link

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.

It seems to work correctly in Edge 18.

@theKashey
Copy link
Owner

Sounds correct 👍

@theKashey theKashey self-assigned this Jul 16, 2019
@theKashey
Copy link
Owner

v3.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants