Skip to content

Commit

Permalink
hide accordion overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
naoufal committed May 25, 2015
1 parent 006e201 commit 83c92bf
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var Accordion = React.createClass({
};
},

toggleAccordion() {
_toggleAccordion() {
this.state.is_visible = !this.state.is_visible;

this.tweenState('height', {
Expand All @@ -51,7 +51,7 @@ var Accordion = React.createClass({
});
},

getContentHeight() {
_getContentHeight() {
this.refs.AccordionContent.measure((ox, oy, width, height, px, py) => {
// Sets content height in state
this.setState({content_height: height});
Expand All @@ -62,16 +62,20 @@ var Accordion = React.createClass({
// Gets content height when component mounts
// without setTimeout, measure returns 0 for every value.
// See https://github.com/facebook/react-native/issues/953
setTimeout(this.getContentHeight);
setTimeout(this._getContentHeight);
},

render() {
return (
/*jshint ignore:start */
<View>
<View
style={{
overflow: 'hidden'
}}
>
<TouchableHighlight
ref="AccordionHeader"
onPress={this.toggleAccordion}
onPress={this._toggleAccordion}
underlayColor={this.props.underlayColor}
style={this.props.style}
>
Expand Down

0 comments on commit 83c92bf

Please sign in to comment.