-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] getViewSwitchingButtonText
prop does not work
#4446
Comments
@alexfauquette started to work on adding support for different languages in #4517 In the DatePicker and DateTimePicker
The component has previous and next buttons. With the support for different languages we may remove props like |
getViewSwitchingButtonText
prop does not work
I think we are not talking about the same text.
I think you are looking for For the |
Seems to be fixed Here are the 3 components with |
Duplicates
Latest version
Current behavior 😯
Note: There are different issues for the DatePicker, DateRangePicker, DateTimePicker, and TimePicker components. See notes below. Let me know if this issue should be split into different bug tickets for each bug occurrence.
In the DatePicker and DateRangePicker components, attempting to override the view switching button's aria-label via
getViewSwitchingButtonText
property does not currently change the aria-label at all.In the DateTimePicker component, the view switch button does not show up at all, even though
showToolbar
is set to true. This results ingetViewSwitchingButtonText
not doing anything at al.In the TimePicker component,
getViewSwitchingButtonText
isn't a supported prop despite the component having a view switch button whenshowToolbar
is set to true.Expected behavior 🤔
DatePicker & DateRangePicker: Supplying a
getViewSwitchingButtonText
prop should override the aria-label in the view switching button.DateTimePicker: The view switching button needs to show up so
getViewSwitchingButtonText
can be usable.TimePicker:
getViewSwitchingButtonText
needs to be a supported prop, as this component has a view switching button whenshowToolbar
is set to true.Steps to reproduce 🕹
Sample: https://codesandbox.io/embed/sharp-ramanujan-3topgp?fontsize=14&hidenavigation=1&theme=dark
Steps:
Context 🔦
I am adding these date/time pickers to my application that supports multiple languages. I'm using
useViewSwitchingButtonText
in each of these components to translate the aria-label of these buttons for each language.Your environment 🌎
`npx @mui/envinfo`
The text was updated successfully, but these errors were encountered: