Authors: @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @DovydasNavickas @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @eps1lon @zieka @dancerphil @dimitropoulos @disjukr @vhfmag
In the context of a PR moving the (deprecated) KeyboardEvent.keyCode usages in a codebase to KeyboardEvent.key I noticed that the types for this are:
interface KeyboardEvent<...> {
...
/**
* See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
*/
key: string;
...
}
Which makes me wonder if there's any opposition to just including the list of possible named key attribute values into the react types? Here is the list (just item 3 from this document).
Although in the end any value will be accepted because it's still going to need to | string at the end (since all unicode characters are possible values of KeyboardEvent.key), it will help end users because it will provide completion for common values like Enter, Control, Tab, etc.
Any interest?
@types/reactpackage and had problems.Definitions by:inindex.d.ts) so they can respond.Authors: @johnnyreilly @bbenezech @pzavolinsky @digiguru @ericanderson @DovydasNavickas @theruther4d @guilhermehubner @ferdaber @jrakotoharisoa @pascaloliv @Hotell @franklixuefei @Jessidhia @saranshkataria @lukyth @eps1lon @zieka @dancerphil @dimitropoulos @disjukr @vhfmag
In the context of a PR moving the (deprecated)
KeyboardEvent.keyCodeusages in a codebase toKeyboardEvent.keyI noticed that the types for this are:Which makes me wonder if there's any opposition to just including the list of possible named key attribute values into the react types? Here is the list (just item 3 from this document).
Although in the end any value will be accepted because it's still going to need to
| stringat the end (since all unicode characters are possible values ofKeyboardEvent.key), it will help end users because it will provide completion for common values likeEnter,Control,Tab, etc.Any interest?