mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 22:51:09 +08:00
[fix] TouchableHighlight inactive state
TouchableHighlight didn't preserve its original 'backgroundColor' after pressOut. This was caused by the inactive background style (transparent) being applied as an inline style, and so not merging with the original prop style. The patch sets inactive 'backgroundColor' to 'null' so as to remove the inline style and render the backgroundColor from props. Fix #98
This commit is contained in:
@@ -32,7 +32,7 @@ type Event = Object;
|
||||
|
||||
var DEFAULT_PROPS = {
|
||||
activeOpacity: 0.8,
|
||||
underlayColor: 'black',
|
||||
underlayColor: 'black'
|
||||
};
|
||||
|
||||
var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
|
||||
@@ -234,7 +234,7 @@ var TouchableHighlight = React.createClass({
|
||||
accessibilityLabel={this.props.accessibilityLabel}
|
||||
accessibilityRole={this.props.accessibilityRole || this.props.accessibilityTraits || 'button'}
|
||||
ref={UNDERLAY_REF}
|
||||
style={[styles.root, this.state.underlayStyle, this.props.style]}
|
||||
style={[styles.root, this.props.style]}
|
||||
onLayout={this.props.onLayout}
|
||||
hitSlop={this.props.hitSlop}
|
||||
onKeyDown={(e) => { this._onKeyEnter(e, this.touchableHandleActivePressIn) }}
|
||||
|
||||
Reference in New Issue
Block a user