Royal-Navy / design-system

Build web applications that meet the Royal Navy service standards
https://storybook.design-system.navy.digital.mod.uk
Apache License 2.0
103 stars 32 forks source link

DatePickerE: Tabbing away from day in calendar should clear range highlight #2872

Open jpveooys opened 2 years ago

jpveooys commented 2 years ago

When the date picker is in range mode and a second date is being selected (focused) using the keyboard arrow keys, the days between the first and focused date are shaded.

However, the shading isn't cleared when tabbing to a different element. This is due to react-day-picker v7 not exposing a onDayBlur prop (which would allow us to clear the highlight).

However, the prop has been added for react-day-picker v8 which is currently in beta, so this should be fixable once a stable version of it is released.

jpveooys commented 2 years ago

Note: v8 is due for release before the end of the year: https://github.com/gpbl/react-day-picker/discussions/1316

We could start using it for DatePickerE only using an alias.

gpbl commented 2 years ago

👋 hey thanks for looking at react-day-picker!

Please remember v8 is a major update mainly incompatible with the previous version. If you are evaluating the beta or considering to upgrade, consider to contact the mantainers at the DayPicker Slack. We can help for real use-cases for DayPicker and see how it is implemented around.

jpveooys commented 2 years ago

Hi @gpbl :wave:

Thanks for visiting! :smile:

Our date picker component (DatePicker) is built on react-day-picker and we're currently working on a new version of it (DatePickerE) as you've probably gathered :slightly_smiling_face:

We're planning on having a look at migrating DatePickerE to the react-day-picker v8 beta as there's lots of good stuff in there we've been looking for :smile: But realistically, I think this will be in January now (with Christmas time off etc.)

Thanks again!

jpveooys commented 2 years ago

Working branch: https://github.com/defencedigital/mod-uk-design-system/tree/feature/date-picker-e-v8

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has been open for 60 days with no activity