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

[pickers] DateRangeCalendar grid is missing it's accessible name #13534

Closed
kealjones-wk opened this issue Jun 18, 2024 · 2 comments · Fixed by #13538
Closed

[pickers] DateRangeCalendar grid is missing it's accessible name #13534

kealjones-wk opened this issue Jun 18, 2024 · 2 comments · Fixed by #13538
Assignees
Labels
accessibility a11y bug 🐛 Something doesn't work component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! plan: Pro Impact at least one Pro user

Comments

@kealjones-wk
Copy link
Contributor

kealjones-wk commented Jun 18, 2024

Steps to reproduce

Link to live example: https://mui.com/x/react-date-pickers/date-range-picker/#basic-usage

Steps:

  1. on the above page open google chrome dev tools accessibility panel
  2. open the DateRangePickers calendar
  3. notice the grid missing a accessible name.

Current behavior

The grid in the calendar does not have an accessible name.

Expected behavior

The grid would have an accessible name of the current month/year.

DateRangePicker Today:
Screenshot 2024-06-18 at 9 23 52 AM

Compared to DatePicker Today:
Screenshot 2024-06-18 at 9 22 49 AM

Context

The grid lacking an accessible name is bad for accessibility. Additionally it makes it very hard to query for a day relative to the correct calendar. In order to query for a day on the calendar in the same way that a visual user would should be something like this:

within(screen.getByRole('grid', {name: "January 2024"})).getByRole('gridcell', {name: "18"});

Your environment

No response

Search keywords: DateRangePicker, DateRangeCalendar, accessibility, grid
Order ID: 82849

@kealjones-wk kealjones-wk added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 18, 2024
@LukasTy LukasTy self-assigned this Jun 19, 2024
@LukasTy LukasTy added bug 🐛 Something doesn't work accessibility a11y plan: Pro Impact at least one Pro user component: pickers This is the name of the generic UI component, not the React module! component: DateRangePicker The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 19, 2024
@LukasTy
Copy link
Member

LukasTy commented Jun 19, 2024

Thank you for reporting this problem! 🙏
This also helped surface not the most ideal testing method that we resorted to in the absence of this support. 🙈

const getPickerDay = (name: string, picker = 'January 2018') =>
getByRole(screen.getByText(picker)?.parentElement?.parentElement!, 'gridcell', { name });

Copy link

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@kealjones-wk: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y bug 🐛 Something doesn't work component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! plan: Pro Impact at least one Pro user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants