dan-lee / timescape

A flexible, headless date and time input library for JavaScript. Provides tools for building fully customizable date and time input fields, with support for libraries like React, Preact, Vue, Svelte and Solid.
https://timescape.daniellehr.de
MIT License
153 stars 2 forks source link

refactor(core): allow more permissive event propagation on `keydown` #23

Closed SeanCassiere closed 3 months ago

SeanCassiere commented 3 months ago

Currently, all keydown events have preventDefault and stopPropagation 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:

The PR adds the following:

Unit tests have been added to cover both additions of the keyboard navigation events for Enter and Tab.

Fixes #22

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: 8b43c3fab9ad67abeaa5486902dc3e84a2a679d5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | --------- | ----- | | timescape | Minor | | demo | Patch |

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

dan-lee commented 3 months ago

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

SeanCassiere commented 3 months ago

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!

dan-lee commented 3 months ago

This has been released in https://github.com/dan-lee/timescape/releases/tag/timescape%400.5.0 🚀

Thanks for your contribution @SeanCassiere!