Skip to content
This repository has been archived by the owner on May 13, 2019. It is now read-only.

Commit

Permalink
Merge pull request #241 from mvayngrib/fixunderlaystyle
Browse files Browse the repository at this point in the history
fix underlay style
  • Loading branch information
yuanyan authored May 2, 2017
2 parents 1074eca + b1e244c commit c6e975d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Libraries/Touchable/TouchableHighlight.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Mixin as NativeMethodsMixin } from 'NativeMethodsMixin';
import StyleSheet from 'ReactStyleSheet';
import mixin from 'react-mixin';
import autobind from 'autobind-decorator';
import flattenStyle from 'ReactFlattenStyle';

type Event = Object;

Expand All @@ -38,6 +39,11 @@ var INACTIVE_UNDERLAY_PROPS = {
style: StyleSheet.create({x: {backgroundColor: 'transparent'}}).x,
};

var DEFAULT_UNDERLAY_STYLE = {
...DEFAULT_PROPS.style,
...INACTIVE_UNDERLAY_PROPS.style
}

class TouchableHighlight extends Component {
static propTypes = {
...TouchableWithoutFeedback.propTypes,
Expand Down Expand Up @@ -78,11 +84,10 @@ class TouchableHighlight extends Component {
backgroundColor: props.underlayColor,
}
},
underlayStyle: [
DEFAULT_PROPS.style,
INACTIVE_UNDERLAY_PROPS.style,
props.style,
]
underlayStyle: flattenStyle([
DEFAULT_UNDERLAY_STYLE,
props.style
])
};
}

Expand Down

0 comments on commit c6e975d

Please sign in to comment.