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

[SelectField] label is influenced by text-align css property #4847

Closed
PhilipGarnero opened this issue Jul 29, 2016 · 3 comments
Closed

[SelectField] label is influenced by text-align css property #4847

PhilipGarnero opened this issue Jul 29, 2016 · 3 comments
Labels
component: select This is the name of the generic UI component, not the React module!

Comments

@PhilipGarnero
Copy link

Problem description

When a SelectField component is inside another component having the css property text-align set, the label is also affected.

Steps to reproduce

Go to the select field demo page and put a text-align: center or right on any parent container (the "simple examples" for instance or the whole page). Then try this on the text field page. You'll see that you don't get the same behavior.

Versions

  • Material-UI: 0.15.2
  • React: 15.2.1
  • Browser: Chrome 51.0.2704.106
@mpontikes mpontikes mentioned this issue Aug 5, 2016
13 tasks
@oliviertassinari oliviertassinari added the component: select This is the name of the generic UI component, not the React module! label Mar 26, 2017
@oliviertassinari oliviertassinari changed the title SelectField's label is influenced by text-align css property [SelectField] label is influenced by text-align css property Mar 26, 2017
@mjsevilla
Copy link

mjsevilla commented May 5, 2017

Has this been fixed yet? I am experiencing this issue as well..A semi-workaround is making a CSS rule specific for that SelectField with text-align: left. This will fix the selected text, just not the floating label.
screen shot 2017-05-05 at 2 27 09 pm

@MikeMuxika
Copy link

MikeMuxika commented Aug 7, 2017

@mjsevilla Not sure if you've solved this for yourself but if you override the position: absolute, you could get the customization you need. But a better option would be to add text-align: left to the container element housing your select field.

@gregStevenard
Copy link

For anyone looking to achieve this in latest version of material ui, it can be done through overriding the input through the theme :

const theme = createMuiTheme({
  overrides: {
        MuiSelect:{
            root:{
                textAlign:'left'
            }
        }
   }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

5 participants