React: KeyboardEvent.repeat is not normalized

Created on 16 Aug 2018  路  7Comments  路  Source: facebook/react

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.

DOM Stale Feature Request Needs Investigation

Most helpful comment

@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.

All 7 comments

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

@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.

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

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

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

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.

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!

Was this page helpful?
0 / 5 - 0 ratings