mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.79k stars 1.9k forks source link

Calendar component aria labeling wrong and props to fix it don't work #6835

Closed astolman closed 1 month ago

astolman commented 1 month ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

7.12.2

What package has an issue?

@mantine/dates

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

Chrome

Describe the bug

The Calendar component's forward and back buttons do not have proper aria labeling. Whether or not you use the nextLabel and previousLabel props, lighthouse is reporting that there is no accessible name for the buttons. The docs https://mantine.dev/dates/calendar/?t=props say that these nextLabel and previousLabel props should set these aria labels, but they aren't working.

Below is a screenshot of the lighthouse report. I have also included a code sandbox which i was able to run lighthouse over and replicate the issue. image

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/mantine-react-template-forked-vstc7z

Possible fix

No response

Self-service

Kenzo-Wada commented 1 month ago

You can use ariaLabels props to set arialabels!

https://mantine.dev/dates/calendar/?t=props

astolman commented 1 month ago

You can use ariaLabels props to set arialabels!

https://mantine.dev/dates/calendar/?t=props

I couldnt find any docs that described what type this prop takes. I guess I'll go take a look in the repo. Will update here with the results.

astolman commented 1 month ago

The ariaLabels prop does work, thank you! I think the broken props should probably just be removed or fixed and the docs updated.

Kenzo-Wada commented 1 month ago

@astolman

YEAH, you are so right! I just now created a PR for the correction! :ok_hand: