[wp-trac] [WordPress Trac] #63759: Replace event.keyCode with event.key
WordPress Trac
noreply at wordpress.org
Tue Jul 29 19:15:52 UTC 2025
#63759: Replace event.keyCode with event.key
-------------------------+------------------------------
Reporter: joedolson | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: minor | Resolution:
Keywords: | Focuses: javascript
-------------------------+------------------------------
Comment (by joedolson):
@jonsurrell I'd say that having a package that depends on a deprecated
property continuing to be supported is a bit risky. But it does have the
advantage that it's already abstracted, so if it needs to be updated at
some point, that should be pretty manageable.
I'm more concerned about the core scripting, because it's not abstracted,
so if any browser actually removed keyCode, it would be a pretty big
project to resolve it. I think that the abstractions in
@wordpress/keycodes make that a much easier task.
I don't honestly think there's a lot of risk here - there's just too much
dependence on `keyCode` across the web for it to be removed, but we can
reduce the surface of the problem pretty easily.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63759#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list