Skip to content
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

Label Text left aligned when dir=rtl #9332

Closed
1 task done
mbrevda opened this issue Nov 29, 2017 · 11 comments
Closed
1 task done

Label Text left aligned when dir=rtl #9332

mbrevda opened this issue Nov 29, 2017 · 11 comments
Labels
support: question Community support but can be turned into an improvement

Comments

@mbrevda
Copy link

mbrevda commented Nov 29, 2017

When using a RTL language, the label text seems to still be left aligned.


Expected Behavior

Label text should be right aligned when dir="rtl"

Current Behavior

Label text is always left aligned:

dir="ltr" dir="rtl"
screen shot 2017-11-29 at 4 41 34 pm screen shot 2017-11-29 at 3 03 04 pm

Steps to Reproduce (for bugs)

Here is a minimal demo: https://942ywwnk4w.codesandbox.io/

Context

My labels are showing on misaligned, as per the screenshot above.

Inspecting the styles shows the text is `transform`ed to `top left` instead of `top right`
.MuiInputLabel-formControl-188 {
    top: 0;
    left: 0;
    position: absolute;
    transform: translate(0, 23px) scale(1);
}

.MuiInputLabel-root-187 {
    transform-origin: top left;
}

Your Environment

Tech Version
Material-UI beta.22
React 16.1
browser Chrome
@alitaheri
Copy link
Member

alitaheri commented Nov 29, 2017

Make sure you've properly set up rtl for material-ui ( you can find it in the docs ). I'm sure you haven't properly set up rtl support. The docs are working properly when rtl.

@oliviertassinari
Copy link
Member

@alitaheri I think he has: https://codesandbox.io/s/m5nl4547yp

@oliviertassinari
Copy link
Member

Wait, the demo is all broken.

@oliviertassinari
Copy link
Member

I think we can close, the demo is invalid, plus it's working on the documentation side:
capture d ecran 2017-11-29 a 16 55 45

@oliviertassinari oliviertassinari added the support: question Community support but can be turned into an improvement label Nov 29, 2017
@mbrevda
Copy link
Author

mbrevda commented Nov 29, 2017

Can you elaborate about what is invalid in the demo?

@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 29, 2017

@mbrevda You need to follow the steps of the documentation: https://material-ui.com/guides/right-to-left/

@mbrevda
Copy link
Author

mbrevda commented Nov 29, 2017

I did step 1 2 & 3 seem to apply only for custom themes? Or did I misunderstand?

@oliviertassinari
Copy link
Member

oliviertassinari commented Nov 29, 2017

@mbrevda No, 3 has nothing to do with the theme. But you need a custom theme for 2.

@mbrevda
Copy link
Author

mbrevda commented Nov 29, 2017

this has nothing to do with the theme.

Indeed. I found the instructions confusing. Thanks!

@mbrevda mbrevda closed this as completed Nov 29, 2017
@mbrookes
Copy link
Member

@mbrevda Since you've been through the exercise, please could you submit a small PR to clarify the docs in the area you found confusing? It would help us and everyone else. 👍

@mbrevda
Copy link
Author

mbrevda commented Nov 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

4 participants