question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Label Text left aligned when dir=rtl

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mbrevdacommented, Nov 29, 2017

this has nothing to do with the theme.

Indeed. I found the instructions confusing. Thanks!

0reactions
mbrevdacommented, Nov 29, 2017

I was thinking of a RTL component that would alleviate a lot of the pain. I’m not familiar enough with either jss or this project, but I put something together for myself. It seems a component (if doable/scalable) would be a lot simpler?

On Wed, Nov 29, 2017, 9:49 PM Matt Brookes notifications@github.com wrote:

@mbrevda https://github.com/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. 👍

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mui-org/material-ui/issues/9332#issuecomment-347975420, or mute the thread https://github.com/notifications/unsubscribe-auth/AAR4jBj6hyhdSyYlColNcUjDnkuhxDmNks5s7bVVgaJpZM4QvE8o .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Label Text left aligned when dir=rtl #9332 - mui/material-ui
When using a RTL language, the label text seems to still be left aligned. I have searched the issues of this repository and...
Read more >
Structural markup and right-to-left text in HTML
Quick answer. If the overall document direction is right-to-left, add dir="rtl" to the html tag.
Read more >
How to Align Labels Next to Inputs
In this snippet, you'll learn how to align elements next to elements. Align labels to the right and left of inputs by using...
Read more >
Automactially set direction and text-align based on rtl or ltr ...
Its OK, I can write separate css for both directions, but what could be the best way to switch between these css(e.g, in...
Read more >
How to Align Text in HTML – Text-align, Center, and ...
For example, by default, English moves from left to right. ... For example, you could use the center tag to align your text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found