Replies: 3 comments
-
Hey @aitchkhan, is there any progress about this feature? Or maybe you can share you thoughts on how to achieve this behavior? |
Beta Was this translation helpful? Give feedback.
-
Bump on this - would be useful :) |
Beta Was this translation helpful? Give feedback.
-
Hi @WillTaylor22, Having However, the useEffect(() => {
const parsedSelectedDate = defaultDateLib.format(selectedDate, "yyyy-MM-dd");
const selectedCalendarDayEl = document.querySelector(
`[data-day="${parsedSelectedDate}"] button`
);
if (selectedCalendarDayEl && selectedCalendarDayEl instanceof HTMLElement) {
selectedCalendarDayEl.focus();
}
}, []);
return <DayPicker ... /> |
Beta Was this translation helpful? Give feedback.
-
This is a feature request.
We have recently been working on making our application more accessible. This feature request has an influence of the work that we are doing to make our application WCAG 2.0 AA compliant atleast.
For our specific use-case we don't show DayPicker by default. When it opens up, we want to have a focus on the selected day. That way, it will be read out by the screen reader and it will be easier for the user to navigate via the keyboard.
Approach:
Add a
focus
prop which takes a date object and steal focus on that one.I can create a PR for this.
Beta Was this translation helpful? Give feedback.
All reactions