[TouchableHighlight] Preserve underlay style when restoring inactive props
Summary: If you give a TouchableHighlight component some styling (e.g. a background color) with the `underlayStyle` prop, the style is wiped away after touching the component. This diff restores the `underlayStyle`. Closes https://github.com/facebook/react-native/pull/129 Github Author: James Ide <ide@jameside.com> Test Plan: Create a TouchableHighlight that receives `underlayStyle={{style: 'blue'}}`. It initially has a blue background. Touch it and let go. See the blue background now comes back as expected.
This commit is contained in:
parent
c43d1458c7
commit
f002fda275
|
@ -159,7 +159,10 @@ var TouchableHighlight = React.createClass({
|
|||
this._hideTimeout = null;
|
||||
if (this.refs[UNDERLAY_REF]) {
|
||||
this.refs[CHILD_REF].setNativeProps(INACTIVE_CHILD_PROPS);
|
||||
this.refs[UNDERLAY_REF].setNativeProps(INACTIVE_UNDERLAY_PROPS);
|
||||
this.refs[UNDERLAY_REF].setNativeProps({
|
||||
...INACTIVE_UNDERLAY_PROPS,
|
||||
style: this.state.underlayStyle,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue