From 83e4c68461d6a93458ad41d8aa18bf34236e8f29 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Wed, 16 Mar 2016 00:36:06 -0700 Subject: [PATCH] [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 --- src/components/Touchable/TouchableHighlight.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Touchable/TouchableHighlight.js b/src/components/Touchable/TouchableHighlight.js index 5f2594c1..27f1857b 100644 --- a/src/components/Touchable/TouchableHighlight.js +++ b/src/components/Touchable/TouchableHighlight.js @@ -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) }}