-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Conversation
style={this.prepareStyles(styles.floatingLabel, this.props.floatingLabelStyle)} | ||
<TextFieldLabel | ||
muiTheme={this.state.muiTheme} | ||
style={this.mergeStyles(styles.floatingLabel, this.props.floatingLabelStyle)} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mm, okay, I see.
@newoga Thanks for the feedbacks 👍 👍 @oliviertassinari Do you think this is ok to merge 😁 |
[TextField] Extract floating label
@alitaheri Yes, thanks for this 😄 |
A part of #2555