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

Possibility to handle focus from outside #822

Closed
ihardyslide opened this issue Apr 10, 2024 · 3 comments
Closed

Possibility to handle focus from outside #822

ihardyslide opened this issue Apr 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ihardyslide
Copy link

Is your feature request related to a problem? Please describe.
Hi,
I already opened an A11y issue ticket for this library before and I was really impressed by the speed you delivered a fix.
Thank you very much again for this.

Unfortunately, I need to bug you again with some accessibility issue.
We have tried to adapt the Datepicker from outside, to align it as much as possible with the W3C suggestion regarding datepickers.
We came across an issue, which we currently are not able to solve without forking the library.
That's why I first want to ask, if it is maybe an improvement for everybody and therefore can go into your original library.

W3C suggests following points, which we could not implement without a fork:

  • while navigating inside the calendar, one should be able to jump to the first/last day of the current week, by pressing HOME or END key on your keyboard
  • while navigating inside the calendar, one should be able to jump to the previous/next month, by pressing PAGE UP or PAGE DOWN key
  • while navigating inside the calendar, one should be able to jump to the previous/next year, by pressing SHIFT + PAGE UP or SHIFT + PAGE DOWN

I was only able to visually shift the focus via javascript, but could not actually set the index of the focus inside the datepicker.
That means e.g., after pressing END key, the focus visually moves to the last day of the current week, but as soon as I press some arrow-key, let's say RIGHT-ARROW for this example, the focus will jump back to the day I was before pressing END and then go to the next day.

Describe the solution you'd like
I see two possible solutions for this:

  1. You try to implement the W3C suggestions into the datepicker by default
  2. You implement some feature (prop or something?) which provides a possibility to modify the current focus from outside of the element.

Describe alternatives you've considered
I will have to fork the library then I guess, I did not find any other solution yet.

Additional context
2024-04-10 14_08_05-Debian 11 Fresh  wird ausgeführt  - Oracle VM VirtualBox

Pressing END key
2024-04-10 14_08_20-Debian 11 Fresh  wird ausgeführt  - Oracle VM VirtualBox

Pressing RIGHT-ARROW
2024-04-10 14_08_39-Debian 11 Fresh  wird ausgeführt  - Oracle VM VirtualBox

@ihardyslide ihardyslide added awaiting triage The issue is not reviewed by the maintainers enhancement New feature or request labels Apr 10, 2024
@Jasenkoo Jasenkoo removed the awaiting triage The issue is not reviewed by the maintainers label Apr 14, 2024
@ihardyslide
Copy link
Author

Hi,

thanks for the update.
Unfortunately, it does not seem to work properly for me.

I have found following points which I would consider as a11y issue:

  • When pressing HOME or END key, the focus jumps to the wrong day.
    It seems like, that the focus considers the current day as currently focused day, because it jumps inside the week, which has the current day in it.
  • When pressing PAGE UP/PAGE DOWN or SHIFT + PAGE UP/SHIFT + PAGE DOWN to switch month or respectively year, the focus is lost completely. I have to press TAB to get the focus inside the datepicker again.
    The W3C example sets the focus on the same day as the last focused day.
    e.g. Current focus is on 22.04.2024 --> press PAGE UP --> focus is on 22.03.2024

What do you think about this?
Here you can see a video of mentioned points:

Debian.11.Fresh.wird.ausgefuhrt.-.Oracle.VM.VirtualBox.2024-04-22.14-48-32.mp4

Thanks & BR

@ihardyslide
Copy link
Author

Hi,

any update on this?

Thx & BR

@Jasenkoo
Copy link
Contributor

I missed it completely, will re-open as bug

@Jasenkoo Jasenkoo reopened this May 15, 2024
@Jasenkoo Jasenkoo added bug Something isn't working and removed enhancement New feature or request labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants