Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #175 'Content is laid out repeatedly during expand animation' #180

Merged
merged 2 commits into from
May 15, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix #175 'Content is laid out repeatedly during expand animation'
  • Loading branch information
andriichernenko authored Apr 24, 2018
commit 0f4ac6559bf307ef7fa0aaead635e27bce4495ed
12 changes: 10 additions & 2 deletions Collapsible.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Animated, Easing } from 'react-native';
import { Animated, Easing, View } from 'react-native';
import { ViewPropTypes } from './config';

const ANIMATED_EASING_PREFIXES = ['easeInOut', 'easeOut', 'easeIn'];
Expand Down Expand Up @@ -197,13 +197,21 @@ export default class Collapsible extends Component {
}
return (
<Animated.View style={style} pointerEvents={collapsed ? 'none' : 'auto'}>

<Animated.View
ref={this._handleRef}
style={[this.props.style, contentStyle]}
onLayout={this.state.animating ? undefined : this._handleLayoutChange}
>
{this.props.children}

<View style={{ height: measured ? contentHeight : null }} >

{this.props.children}

</View>

</Animated.View>

</Animated.View>
);
}
Expand Down