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] No longer rely on floatingLabelText to get correct styling #976

Merged
merged 3 commits into from
Jul 2, 2015

Conversation

tylermichael
Copy link
Contributor

If you had a SelectField component without a floatingLabelText prop, you would end up getting a messed up looking component. This fixes that.

Also fixes #934.

@hai-cea
Copy link
Member

hai-cea commented Jun 28, 2015

@tylermichael Something still seems to be weird. Here's what I see when I remove the floatingLabelText
image

@tylermichael
Copy link
Contributor Author

Hmm... Are you sure that you are on the correct branch? That picture is what I was seeing before I made these changes. I have pulled my branch on two separate machines, a Windows and a Mac, both showing the same thing.

What browser and OS are you using?

Here is what I am seeing:

screenshot 2015-06-28 21 52 14

After making a selection:
screenshot 2015-06-28 21 52 33

@tylermichael
Copy link
Contributor Author

I think I see what you are doing now...

Are you doing something like this?

<SelectField
   value={this.state.selectValue2}
   onChange={this._handleSelectValueChange.bind(null, 'selectValue2')}
   menuItems={arbitraryArrayMenuItems} />

If so, working on a fix.

@tylermichael
Copy link
Contributor Author

Alright check it out now. Here's what it looks like:

capture2

@oliviertassinari
Copy link
Member

Oh, I made an other PR for the same issue, oups. #994

@hai-cea
Copy link
Member

hai-cea commented Jul 1, 2015

@oliviertassinari Is there any difference between yours and this one?
@tylermichael It's working for me now as well. Thanks.

@oliviertassinari
Copy link
Member

@hai-cea From what I can see, I have less changes on the css.
I'm just using top: this.props.floatingLabelText ? 16 : -8,.
And this seems to be enough.

hai-cea added a commit that referenced this pull request Jul 2, 2015
[SelectField] No longer rely on floatingLabelText to get correct styling
@hai-cea hai-cea merged commit 899b6f6 into mui:master Jul 2, 2015
@hai-cea
Copy link
Member

hai-cea commented Jul 2, 2015

Thanks @tylermichael

@zannager zannager added component: select This is the name of the generic UI component, not the React module! package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. labels Mar 14, 2023
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! package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SelectField] Clicking floatingLabelText changes SelectField to first item in list
4 participants