-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
[Dialog] support rtl direction in dialog #32194
Conversation
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 don't understand this PR. It seems to be about adding the dir
attribute on the modal's root element but this should already be set on the body, this attribute inherits to all the children.
https://mui.com/guides/right-to-left/#1-html
IMHO #32022 is a "behave as expected". Its reproduction is not following the instructions. The same reproduction following the instructions: https://codesandbox.io/s/stupefied-frost-o4zcd9?file=/src/index.js.
@oliviertassinari Thanks for the information. If #32022 is not a bug or does not have to be fixed, I will close this PR. |
Now, while I'm at it, I had a deeper dive, to see if we are not missing any opportunities. https://www.w3.org/International/questions/qa-html-dir suggests that @kyeongsoosoo Let's wait @michaldudak inputs. |
What about cases where only part of the content of a page should be in RTL mode (a dictionary or translator app, for example). The |
@michaldudak Would |
Even |
@michaldudak Even better 👌, so no implementation change is needed, there is already a native API. What I would suggest:
|
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 unsubscribed to the thread, I gave a perspective on the matter, it's out of my hands now, I'm also removing the "request changes" review.
@michaldudak If it is decided to update the docs and no implementation on code is needed, should I close this PR? |
@kyeongsoosoo yes, sorry for the confusion. I'll update the docs in another one. |
Closes #32022
Modal
usesPortal
, so It seems thatdir
attribute fromroot
is not applied toModal
(includesDialog
), so I added a prop forModal
to checkdir
. Ifdir
isrtl
,dir
attribute is passed toRoot
component inModalUnstyled
.(I referred to the
Slider
component.)Dialog
usesModal
, so the bug is fixed.Here is my Demo