react-modal
react-modal copied to clipboard
[fixed] switched from KeyboardEvent.keyCode to KeyboardEvent.code
Fixes #952.
Changes proposed:
- Switch keydown event listeners to use
KeyboardEvent.code. The legacyKeyboardEvent.keyCodeis deprecated. Since React 18 dropped support for IE, we don't need to fall back on it, and can simply switch to the new property - More context: see #952
Acceptance Checklist:
- [x] The commit message follows the guidelines in
CONTRIBUTING.md. - ~Documentation (README.md) and examples have been updated as needed.~
- ~If this is a code change, a spec testing the functionality has been added.~
- ~If the commit message has [changed] or [removed], there is an upgrade path above.~
Sorry for the wait here, @diasbruno—pretty busy and the testing setup makes contributing less straightforward than I expected. I've followed-up on discussions above 🙂
@diasbruno as mentioned in https://github.com/reactjs/react-modal/pull/953#discussion_r906086501 I tweaked the test helpers and added a couple of tests that cover the KeyboardEvent.code logic in some scenarios. Let me know if I should also update other test cases using the legacy test helpers.
Also FYI: locally I have ~2-4 unrelated tests failing, they seem a bit flaky. I'm running Node 14, maybe that's it? (I've seen Node 8 mentioned in some config files, but surely that's a leftover.) Anyways since it's also failing on master for me, it's unrelated to this PR
Let me know if there's anything else or if we can move forward with this 🙂
Grande lavoro! :tada:
I'll finish the review later, but it seems that everything looks great.
Thanks for the contribution.
Amazing! Thanks @diasbruno 🙂
@diasbruno just checking in 🙂 let me know if there's something else I can do on my side!

(PS. no offence meant at all, just stumbled upon the issue again and I wanted to check if there's anything we can do to bring the change over the line 🙂 but totally understand that it can take some time)
@robinmetral Thanks for pinging me...It's been hard to find time to manage this repo. Today I have another PR to merge, so I'll add this one to release a new version.
Done. @robinmetral sorry for taking so long...:joy:
No worries at all, and thanks a lot for the review and release! 🙌
@robinmetral Just released version 3.16.1. Thanks for taking the time to work on this.