duetds / date-picker

Duet Date Picker is an open source version of Duet Design System’s accessible date picker. Try live example at https://duetds.github.io/date-picker/
https://www.duetds.com
MIT License
1.73k stars 68 forks source link

Arrow key navigation fails when min or max date limit reached #60

Closed nickyblissAviva closed 3 years ago

nickyblissAviva commented 3 years ago

Describe the bug If a min or max date is set and the arrow keys are used to attempt to navigate beyond the date the arrow key navigation stops updating correctly leaving the focus'd date the date closest to the limit. If tab/shift-tab is used it can kick the picker into updating the focus state to where it should have been.

To Reproduce Steps to reproduce the behaviour:

  1. Open a picker with a max date set
  2. Use right or down arrow key to navigate to the end date and use keys to attempt to navigate beyond the max date
  3. Use up or left arrow keys to try and navigate back within range
  4. Focus'd date never updates although month may change

Expected behaviour When trying to navigate beyond a min or max date focus should remain on the min/max date allowed. When navigating back within range the focus should update immediately

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

WickyNilliams commented 3 years ago

It seems to behave fine for me? I have attached a video showing the current behaviour, which is as expected. You can see that I attempt to navigate beyond the max multiple times. It does not allow me, and I am able to immediately return to navigating allowed dates:

https://user-images.githubusercontent.com/1091390/106144345-faad7a00-616b-11eb-8964-6c0eab7d2b5c.mp4

It's possbile this was fixed in the release I made earlier today v1.2.0. Please test and let me know

nickyblissAviva commented 3 years ago

@WickyNilliams We've retested in all of the browsers/OS combos originally mentioned in the ticket and looks like your update has fixed the issue we had found. :smile:

WickyNilliams commented 3 years ago

Awesome! Glad to hear it