Skip to content

Possibility to handle focus from outside #822

Closed
@ihardyslide

Description

@ihardyslide

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions