-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[Chip] Adornments are misaligned when using RTL partially #45193
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
Comments
Thanks for reporting this @ma7899 ~ the example in your sandbox didn't do the RTL setup, it's documented here: https://mui.com/material-ui/customization/right-to-left/#setup If your project is 100% RTL (i.e. you will set However I noticed a related bug where if RTL is set partially, chips placed in the LTR parts are misaligned so I've updated the issue description |
Can someone fix it ? |
Are you interested in creating a PR? 😬 If so we can guide you ~ |
@mj12albert I will work on it. |
@solomonalem Are you still working on this issue? If not I am more than happy to work on it |
I would honestly not accept the issue, there are probably bunch of issues if RTL is partially set up. Even if RTL is not used on the whole page, developers can add dir="rtl" on the wrapping element where it is used, e.g. https://codesandbox.io/p/devbox/relaxed-kowalevski-24gvrz-forked-69gltc?workspaceId=ws_LCQafiBEJ7ynffHYRMAZL. @alisasanib I am happy to accept the PR as it is anyway an improvement, but if we decide to do it, we should do it for all components. I would first recommend investigating if that will improve the overall workflow for setting up RTL, as from the investigations we did in Base UI, developers will probably always need to apply both the dir="rtl" and some RTL context anyways. |
@mnajdova You're absolutely right — both This issue becomes noticeable when a user adds To address your point — while this change may not dramatically improve the global RTL setup workflow, it does make it easier for users to apply directionality on a per-section basis without unintended side effects. I'd be more than happy to look into other components where similar directional styling might cause issues. I can provide reproducible examples along with potential solutions. From there, we can evaluate whether it's worth addressing these inconsistencies and how we might prioritize improvements. Please let me know if you're happy with this approach and whether you consider this a bug worth fixing and addressing. |
Closing, we don't support "partial RTL configuration". See https://mui.com/material-ui/customization/right-to-left/. One thing that could be interesting to do is to put in place better failure recovery logic. Maybe there is a way to log an error message when this is wrongly configured. But this would likely involve: reading the DOM, seeing the mismatch, and flagging. For 2% of the user base, I suspect that it's not worth the runtime slowness in dev mode. So there isn't much we can do. As for using logical CSS properties, this seems to make things even worse: #45679 (comment). |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. |
Repro:
https://codesandbox.io/p/sandbox/confident-driscoll-24gvrz?file=%2Fsrc%2FApp.js%3A1%2C1
Steps to reproduce
dir="rtl"
to part of the appCurrent behavior
when the direction of a parent is RTL the chips content is disrupted and the places are not correct.
specially on Delete.
Expected behavior
It has to be well alligned.
Context
I am using chip in RTL website.
Your environment
npx @mui/envinfo
Search keywords: RTL Chip Bug
The text was updated successfully, but these errors were encountered: