react-day-picker icon indicating copy to clipboard operation
react-day-picker copied to clipboard

Focus navigation breaks with disabled days

Open gpbl opened this issue 4 years ago • 5 comments

Bug description

When navigating the calendar with the keyboard the focus breaks when the day to focus is disabled

To reproduce

Code sandbox: https://codesandbox.io/s/react-day-picker-8-vl4ry

Steps

Focus the calendar and move with the arrows until a disabled day is met. The focus get lost.

Expected behavior

The focus should get to the next (or previous?) focusable (not disabled) day. If there are no days to navigate to, the focus should stay in the last navigable day.

Additional notes

Test should check all the keyboard combinations. Consider the specific use cases (e.g. navigate end of week when end of week is disabled).

gpbl avatar Dec 07 '21 12:12 gpbl

@tjfred35 do you think the recent updates to focus may help fixing this?

gpbl avatar Dec 15 '21 12:12 gpbl

No -- those updates only changed the initial focus. This is still an issue.

tjfred35 avatar Dec 15 '21 13:12 tjfred35

Is this in the plans to be fixed? It has a further issue, see this sandbox: https://codesandbox.io/s/sandpack-project-forked-i07lee?file=/App.tsx If one selects the 3rd of January 2015 and then left arrow 3 times it will jump into the disabled month. From there the arrow keyboard navigation is no longer working.

milorava avatar Apr 25 '22 16:04 milorava

I'm also seeing this issue and the one that @milorava mentioned above. Is there any move to fix this?

caydgreen avatar May 10 '22 21:05 caydgreen

If #1449 get fixed probably we can move forward and fix this one too!

Is this in the plans to be fixed? Is there any move to fix this?

Yes @caydgreen @milorava please consider sponsoring my work: https://github.com/sponsors/gpbl 🙏

gpbl avatar May 12 '22 14:05 gpbl