-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Fix a bug of calling prepareStyles twice #1923
Conversation
@@ -112,7 +112,7 @@ const DropDownIcon = React.createClass({ | |||
<div onTouchTap={this._onControlClick}> | |||
<FontIcon | |||
className={iconClassName} | |||
style={this.prepareStyles(iconStyle)}>{this.props.iconLigature}</FontIcon> | |||
style={iconStyle}>{this.props.iconLigature}</FontIcon> |
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.
Shouldn't we use this.mergeStyle
to ensure that the auto-prefixer do his job?
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.
<FontIcon>
(and all material components) use prepareStyles
when passing styles to dom elements. So we shouldn't prefix anything passed to another 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.
In other words, all flipping and prefixing should only be done before passing the style object to a dom element.
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.
But what if I want to use the iconStyle
property of DropDownIcon
on his own?
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 don't see why you can't. iconStyle
is still passed down to the internal <div>
generated by <FontIcon>
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.
You are right, I have overlook the fact that this is not a raw html component, it's FontIcon
👍. I should get some sleep
Closed & reopened to restart Travis build. |
[DropDownIcon] Fix a bug of calling prepareStyles twice
Thanks @louy! |
Closes #1908