-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Adds RTL verification for the time pickers default views #13447
[pickers] Adds RTL verification for the time pickers default views #13447
Conversation
Deploy preview: https://deploy-preview-13447--material-ui-x.netlify.app/ |
7128d07
to
cc12d23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it should be doable within |
8b27471
to
9b529fb
Compare
} | ||
|
||
const viewsWithoutMeridiem = inViews.filter((view) => view !== 'meridiem'); | ||
return viewsWithoutMeridiem.toReversed().concat('meridiem'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are playing with fire here regarding views. 🙈
Making such structural views
adjustments is tricky and this is the place where such change creates the most problems. 🙈
The tabulation/views process does not work as expected in RTL mode.
Given a demo with default settings, the minutes view is skipped—selecting hours jumps the focus to meridiem and after selecting it the Picker closes.
Have you tried adjusting only the views intended for rendering?
Dude I'm not sure what you changed there but it looks overkill |
If you have ideas on how to do it—the suggestion are welcome. Or do you @Eliav2 have a suggestion on how to achieve it without a breaking DOM change? 🤔 |
9b529fb
to
ef7c577
Compare
packages/x-date-pickers/src/MultiSectionDigitalClock/MultiSectionDigitalClock.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👏
We are snapshot testing docs only in ltr mode, so, any regressions on this regard might go unnoticed.
WDYT about adding an e2e regression test for rtl
behavior? 🤔
(res, currentView) => { | ||
return { ...res, [currentView]: buildViewProps(currentView) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: just to avoid unnecessary diff. 🙈
(res, currentView) => { | |
return { ...res, [currentView]: buildViewProps(currentView) }; | |
(result, currentView) => { | |
return { ...result, [currentView]: buildViewProps(currentView) }; |
f47e20b
to
f65ac35
Compare
Closes #11525