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

[TextField] Extract floating label #2701

Merged
merged 1 commit into from
Dec 30, 2015

Conversation

alitaheri
Copy link
Member

A part of #2555

style={this.prepareStyles(styles.floatingLabel, this.props.floatingLabelStyle)}
<TextFieldLabel
muiTheme={this.state.muiTheme}
style={this.mergeStyles(styles.floatingLabel, this.props.floatingLabelStyle)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider extracting the rest of the styles from styles.floatingLabel and putting it in the TextFieldLabel component? That way the only thing TextField has to pass is the floatingLabelStyle prop?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that means we would have to pass a focused or isFocused prop down to the TextFieldLabel so that it knows how to change styles properly. I think I'm doing something similar for the TextFieldUnderline component.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial thoughts, but it's not that simple. Doing this will couple the components a LOT. In order to calculate the color, hasError, hasValue and errorColor must too be passed down only to calculate a simple color so I left that calculation to the TextField.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mm, okay, I see.

@alitaheri
Copy link
Member Author

@newoga Thanks for the feedbacks 👍 👍

@oliviertassinari Do you think this is ok to merge 😁

oliviertassinari added a commit that referenced this pull request Dec 30, 2015
@oliviertassinari oliviertassinari merged commit 8f63c56 into mui:master Dec 30, 2015
@oliviertassinari
Copy link
Member

@alitaheri Yes, thanks for this 😄

@alitaheri alitaheri deleted the extract-floating-label branch December 30, 2015 10:26
@zannager zannager added the component: text field This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants