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

KeyboardEvent.repeat is not normalized #13411

Closed
craigkovatch opened this issue Aug 16, 2018 · 7 comments
Closed

KeyboardEvent.repeat is not normalized #13411

craigkovatch opened this issue Aug 16, 2018 · 7 comments

Comments

@craigkovatch
Copy link

craigkovatch commented Aug 16, 2018

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Documentation of SyntheticEvent claims: "React normalizes events so that they have consistent properties across different browsers." https://reactjs.org/docs/events.html#supported-events

Documentation of Keyboard Events lists boolean repeat as a supported field: https://reactjs.org/docs/events.html#keyboard-events

IE11/Edge do not natively support repeat, but React does not normalize the event to set repeat: true when a keyDown event repeats (i.e. when a key is held down). (Edge has an open bug on this but of course IE11 is abandonware.)

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Tab to to the only div in this repro and hold down a key:
https://jsfiddle.net/acsr4ofu/

Bug: 'repeat!' alert does not appear in IE11

What is the expected behavior?
An alert dialog showing 'repeat!' should appear in any browser that React supports.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Current version of React, any browser which does not natively support KeyboardEvent.repeat but IE/Edge in particular (Chrome always supported; FF since 28; Safari since 10.1). Unknown if this worked in previous versions of React.

@craigkovatch
Copy link
Author

@gaearon given that the documentation suggests this works but it does not, this seems like a bug not a feature request, no?

@gaearon
Copy link
Collaborator

gaearon commented Aug 16, 2018

@craigkovatch I see where you're coming from but given the pressure to reduce React bundle size the bar for polyfilling something (especially just for IE) is really high. Technically it's missing functionality so I tagged as "feature request". If the fix is small we can get it in, but if it's complicated then it's more likely we'll amend the docs. This needs more investigation into the fix itself.

@craigkovatch
Copy link
Author

craigkovatch commented Aug 16, 2018

@gaearon gotcha. Just to be clear though this is not just IE, also Edge and Safari <10.1. I think that’s a more significant surface area, although not sure what your browser support policy for non-IE is.

@gaearon
Copy link
Collaborator

gaearon commented Aug 16, 2018

We'll need to look at what normalization would involve. If it's not a lot of code I think we can do it.

@craigkovatch
Copy link
Author

#13104 seems somewhat related -- another field to be normalized (although that one is a bit simpler).

@stale
Copy link

stale bot commented Jan 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 10, 2020
@stale
Copy link

stale bot commented Jan 17, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@stale stale bot closed this as completed Jan 17, 2020
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

2 participants