mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-01 10:07:35 +00:00
[fix] TouchableHighlight inactive styles
This commit is contained in:
@@ -106,11 +106,10 @@ var TouchableHighlight = React.createClass({
|
|||||||
backgroundColor: underlayColor,
|
backgroundColor: underlayColor,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
underlayProps: {
|
underlayStyle: [
|
||||||
style: {
|
INACTIVE_UNDERLAY_PROPS.style,
|
||||||
backgroundColor: style && style.backgroundColor || null
|
props.style,
|
||||||
}
|
]
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -206,7 +205,10 @@ var TouchableHighlight = React.createClass({
|
|||||||
this._hideTimeout = null;
|
this._hideTimeout = null;
|
||||||
if (this._hasPressHandler() && this.refs[UNDERLAY_REF]) {
|
if (this._hasPressHandler() && this.refs[UNDERLAY_REF]) {
|
||||||
this.refs[CHILD_REF].setNativeProps(INACTIVE_CHILD_PROPS);
|
this.refs[CHILD_REF].setNativeProps(INACTIVE_CHILD_PROPS);
|
||||||
this.refs[UNDERLAY_REF].setNativeProps(this.state.underlayProps);
|
this.refs[UNDERLAY_REF].setNativeProps({
|
||||||
|
...INACTIVE_UNDERLAY_PROPS,
|
||||||
|
style: this.state.underlayStyle,
|
||||||
|
});
|
||||||
this.props.onHideUnderlay && this.props.onHideUnderlay();
|
this.props.onHideUnderlay && this.props.onHideUnderlay();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -264,6 +266,9 @@ var UNDERLAY_REF = keyOf({underlayRef: null});
|
|||||||
var INACTIVE_CHILD_PROPS = {
|
var INACTIVE_CHILD_PROPS = {
|
||||||
style: StyleSheet.create({x: {opacity: 1.0}}).x,
|
style: StyleSheet.create({x: {opacity: 1.0}}).x,
|
||||||
};
|
};
|
||||||
|
var INACTIVE_UNDERLAY_PROPS = {
|
||||||
|
style: StyleSheet.create({x: {backgroundColor: 'transparent'}}).x,
|
||||||
|
};
|
||||||
|
|
||||||
var styles = StyleSheet.create({
|
var styles = StyleSheet.create({
|
||||||
root: {
|
root: {
|
||||||
|
|||||||
Reference in New Issue
Block a user