Closed SeanCassiere closed 3 months ago
Latest commit: 8b43c3fab9ad67abeaa5486902dc3e84a2a679d5
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Hey @SeanCassiere! Wow, these are awesome changes. Thank you for your deeper look into the code and for fixing the issue! I think this is a great change and increases accessibility!
I am not the biggest fan of switch (true)
statements, but it gets the job done! (patiently waiting for pattern matching...)
As for the changeset, I'd say it's a minor change that also happens to fix things :) I can take care of that
As for the changeset, I'd say it's a minor change that also happens to fix things :) I can take care of that
Thanks!
This has been released in https://github.com/dan-lee/timescape/releases/tag/timescape%400.5.0 🚀
Thanks for your contribution @SeanCassiere!
Currently, all
keydown
events havepreventDefault
andstopPropagation
called on them which makes it a burden on the library to reimplement the native behaviours that are being discarded.This PR changes the following:
#focusNextField
method to return aboolean
representing whether the method actually focused on another element.#handleKeyDown
method to use a more granular approach in the matching ofkeydown
event keys to their respective internal private methods.The PR adds the following:
Tab
key to focus on the next field or allow native event propagation to take place if there isn't another element to focus on.Enter
key to focus on the next field using the same implementation ofArrowRight
.Unit tests have been added to cover both additions of the keyboard navigation events for
Enter
andTab
.Fixes #22