Skip to content

Commit

Permalink
Fix the Portal display to not rerender the entire tree
Browse files Browse the repository at this point in the history
Summary:public
We now wrap the	<RootComponent>	in an <View> where we can control the accessibility at a high level.  This was only used to turn it off for the faded out background view when we show a pop up.

We use setNativeProps instead of setState to avoid the render.	  We really just want to pass this value to the native Android View.

Reviewed By: davidaurelio

Differential Revision: D2928371

fb-gh-sync-id: 19c34471c33650acb526a2f5a02b6070e844e8d0
shipit-source-id: 19c34471c33650acb526a2f5a02b6070e844e8d0
  • Loading branch information
Dave Miller authored and facebook-github-bot-7 committed Feb 17, 2016
1 parent b26f699 commit 7dc1d46
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Libraries/ReactIOS/renderApplication.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ var AppContainer = React.createClass({
return;
}

this.setState({
rootImportanceForAccessibility: modalVisible ? 'no-hide-descendants' : 'auto',
this.refs.accessibilityWrapper.setNativeProps({
importantForAccessibility: modalVisible ? 'no-hide-descendants' : 'auto',
});
},

Expand All @@ -85,10 +85,14 @@ var AppContainer = React.createClass({
ref="main"
collapsable={!this.state.inspectorVisible}
style={styles.appContainer}>
<RootComponent
{...this.props.initialProps}
rootTag={this.props.rootTag}
importantForAccessibility={this.state.rootImportanceForAccessibility}/>
<View
ref="accessibilityWrapper"
collapsable={true}
style={styles.appContainer}>
<RootComponent
{...this.props.initialProps}
rootTag={this.props.rootTag}/>
</View>
<Portal
onModalVisibilityChanged={this.setRootAccessibility}/>
</View>;
Expand Down

0 comments on commit 7dc1d46

Please sign in to comment.