mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(react): icons with MD set should work in browser (#20463)
This commit is contained in:
@@ -34,25 +34,6 @@ class IonIconContainer extends React.PureComponent<InternalProps> {
|
||||
}
|
||||
}
|
||||
|
||||
setIcon() {
|
||||
const { icon, ios, md } = this.props;
|
||||
if (ios || md) {
|
||||
if (isPlatform('ios')) {
|
||||
this.setState({
|
||||
icon: ios ?? md ?? icon
|
||||
});
|
||||
} else if (isPlatform('android')) {
|
||||
this.setState({
|
||||
icon: md ?? ios ?? icon
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setState({
|
||||
icon
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { icon, ios, md, ...rest } = this.props;
|
||||
|
||||
@@ -61,7 +42,7 @@ class IonIconContainer extends React.PureComponent<InternalProps> {
|
||||
if (ios || md) {
|
||||
if (isPlatform('ios')) {
|
||||
iconToUse = ios ?? md ?? icon;
|
||||
} else if (isPlatform('android')) {
|
||||
} else {
|
||||
iconToUse = md ?? ios ?? icon;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"jsx-no-multiline-js": false,
|
||||
"jsx-wrap-multiline": false,
|
||||
"no-empty-interface": false,
|
||||
"no-unbound-method": false
|
||||
"no-unbound-method": false,
|
||||
"prefer-conditional-expression": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user