Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Stuck in a focus loop trying to focus outside day #1567

Closed
DanielJKelly opened this issue Sep 27, 2022 · 0 comments · Fixed by #1576
Closed

Bug: Stuck in a focus loop trying to focus outside day #1567

DanielJKelly opened this issue Sep 27, 2022 · 0 comments · Fixed by #1576
Assignees
Labels
Type: Bug Bug or Bug fixes

Comments

@DanielJKelly
Copy link
Contributor

Bug description

This bug is related to focusing and outside days. It seems to occur in "range" mode when showing multiple months and the day that will be initially focused is part of the selected range and present on one calendar and also on the other calendar as an outside day. Both the "inside" day and the outside day have tabIndex="0" when inspected.

My initial thought is that outside days should not be considered focusable (or maybe at least have it be an option?), but perhaps I am missing a valid use case.

So perhaps this line should be checking for !activeModifiers.outside as well? I haven't tried it out myself though, so it's possible the issue is due to something else.

To reproduce

Fork this CodeSandbox: https://codesandbox.io/s/react-day-picker-8-vl4ry with the code to reproduce the issue.

Steps

  1. Focus the date picker
  2. Press Tab until a day on the calendar is focused
  3. Keep pressing Tab and you will be stuck cycling back between the day being focused and the right arrow being focused. You can sometimes see focus indicator on the outside day flash before focus is shifted to the "inside" day.

Expected behavior

I would expect that the focus should continue on to the next tabbable element and that the button shown below the DayPicker can be focused.

Screenshots

rdp-ex-bug.mov

Additional context

Add any other context about the problem here.

@DanielJKelly DanielJKelly added the Type: Bug Bug or Bug fixes label Sep 27, 2022
DanielJKelly pushed a commit to DanielJKelly/react-day-picker that referenced this issue Oct 7, 2022
@gpbl gpbl self-assigned this Oct 8, 2022
@gpbl gpbl linked a pull request Oct 8, 2022 that will close this issue
@gpbl gpbl added the Status: In Progress Work in Progress label Oct 9, 2022
gpbl added a commit that referenced this issue Oct 9, 2022
Co-authored-by: Dan Kelly <dkelly@neat.com>
Co-authored-by: gpbl <io@gpbl.dev>
@gpbl gpbl linked a pull request Oct 9, 2022 that will close this issue
@gpbl gpbl closed this as completed Oct 9, 2022
@gpbl gpbl removed the Status: In Progress Work in Progress label Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
2 participants