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

Throw or warn when the user passes a downcased key event #368

Closed
cibernox opened this issue Apr 24, 2018 · 1 comment
Closed

Throw or warn when the user passes a downcased key event #368

cibernox opened this issue Apr 24, 2018 · 1 comment

Comments

@cibernox
Copy link
Contributor

triggerKeyEvent now allows to pass a string as third argument, representing the e.key of the dispatched event.

By the KeyboardEvent#key spec, the strings have to be capitalized (Enter instead of enter, Tab instead of tab, ...). But it's easy for users to forget and pass enter, which is invalid but they don't receive any warning or error.

We must help users by detect this mistake.

@mydea
Copy link
Contributor

mydea commented May 24, 2018

Related to this, some of our tests were broken, where we had e.g. triggerKeyEvent('keyup', '13') - which used to work, but then stopped working. Removing the quotes made it work, but it was still pretty confusing, and took some time to figure out what was going on. I think for the sake of backwards-compatibility, it would be nice if it would detect "strings that are actually numbers" and just convert them to a number for you.

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

No branches or pull requests

3 participants