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: tabIndex toggling from 0 to -1 on today or selected day for the first time #1586

Closed
anil1687 opened this issue Oct 17, 2022 · 4 comments · Fixed by #1601
Closed

Bug: tabIndex toggling from 0 to -1 on today or selected day for the first time #1586

anil1687 opened this issue Oct 17, 2022 · 4 comments · Fixed by #1601
Assignees
Labels
Bug Bug or Bug fixes

Comments

@anil1687
Copy link

Bug description

Tabindex is changing from 0 to -1 for focused today/selected day element when we navigate using tab key.

To reproduce

  1. Open https://react-day-picker.js.org/start -Example
  2. Inspect today element(Button) observe the tabIndex is "0"
  3. Navigate using Tab key focus moves from next(>) to today
  4. Observe the tabIndex of today button it is "-1"

Expected behavior

TabIndex of today button should be "0"

Screenshots

image

Additional context

After focusing on today and the tabIndex is "-1", if we tab again it is moving header control(prev button)

@gpbl, this issue is causing my focus loop logic. Due to the tabindex "-1", this element is not considered as focusable element and breaking out of the focus loop.

@anil1687 anil1687 added the Bug Bug or Bug fixes label Oct 17, 2022
@ApplyBoardDak
Copy link

Here's a video reproducing the behaviour (on the homepage). It only ends up looping once but it still seems like an issue.

Screen.Recording.2022-10-18.at.11.59.43.AM.mov

@krishna63
Copy link
Contributor

@gpbl : Let us know your opinion so that we can spend some time and get a solution for it, before diving it will help to understand if there is any reason for making it as -1 after the first blur on the seleced date ?

cc: @anil1687

@gpbl
Copy link
Owner

gpbl commented Nov 6, 2022

I've seen this behavior when working on #1576. The tab indexes seem to work right. It would be nice a unit test to reproduce this case.

@gpbl
Copy link
Owner

gpbl commented Nov 6, 2022

This should be fixed in v8.3.6. @anil1687 please let us know :) thanks for the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants