react-modal icon indicating copy to clipboard operation
react-modal copied to clipboard

[fixed] switched from KeyboardEvent.keyCode to KeyboardEvent.code

Open robinmetral opened this issue 3 years ago • 5 comments

Fixes #952.

Changes proposed:

  • Switch keydown event listeners to use KeyboardEvent.code. The legacy KeyboardEvent.keyCode is 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.~

robinmetral avatar Jun 13 '22 13:06 robinmetral

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 🙂

robinmetral avatar Jun 21 '22 07:06 robinmetral

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

robinmetral avatar Jun 24 '22 13:06 robinmetral

Grande lavoro! :tada:

I'll finish the review later, but it seems that everything looks great.

Thanks for the contribution.

diasbruno avatar Jun 24 '22 16:06 diasbruno

Amazing! Thanks @diasbruno 🙂

robinmetral avatar Jun 26 '22 13:06 robinmetral

@diasbruno just checking in 🙂 let me know if there's something else I can do on my side!

robinmetral avatar Jul 07 '22 16:07 robinmetral

Tumbleweed gif

robinmetral avatar Oct 14 '22 09:10 robinmetral

(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 avatar Oct 14 '22 09:10 robinmetral

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

diasbruno avatar Oct 14 '22 13:10 diasbruno

Done. @robinmetral sorry for taking so long...:joy:

diasbruno avatar Oct 14 '22 22:10 diasbruno

No worries at all, and thanks a lot for the review and release! 🙌

robinmetral avatar Oct 15 '22 07:10 robinmetral

@robinmetral Just released version 3.16.1. Thanks for taking the time to work on this.

diasbruno avatar Oct 18 '22 01:10 diasbruno