Fix android share extension channel switching and searching

This commit is contained in:
Elias Nahum 2018-06-08 14:15:56 -04:00
parent 2ed45dbe28
commit e3e2456ecd
2 changed files with 23 additions and 25 deletions

View file

@ -70,11 +70,6 @@ export default class SearchBarAndroid extends PureComponent {
isFocused: false,
};
}
componentWillReceiveProps(nextProps) {
if (this.state.value !== nextProps.value) {
this.setState({value: nextProps.value});
}
}
cancel = () => {
this.onCancelButtonPress();
@ -153,10 +148,12 @@ export default class SearchBarAndroid extends PureComponent {
} = this.props;
const {isFocused} = this.state;
const inputNoBackground = {
...inputStyle,
};
Reflect.deleteProperty(inputNoBackground, 'backgroundColor');
const {
backgroundColor: bgColor, //eslint-disable-line no-unused-vars
...otherStyles
} = inputStyle;
const inputNoBackground = otherStyles;
let inputColor = styles.searchBarInput.backgroundColor;
if (inputStyle) {

View file

@ -129,21 +129,23 @@ export default class ExtensionTeam extends PureComponent {
}
return (
<SectionList
sections={sections}
ListHeaderComponent={this.renderSearchBar(styles)}
ItemSeparatorComponent={this.renderItemSeparator}
renderItem={this.renderItem}
renderSectionHeader={this.renderSectionHeader}
keyExtractor={this.keyExtractor}
keyboardShouldPersistTaps='always'
keyboardDismissMode='on-drag'
initialNumToRender={10}
maxToRenderPerBatch={10}
stickySectionHeadersEnabled={true}
scrollEventThrottle={100}
windowSize={5}
/>
<View>
{this.renderSearchBar(styles)}
<SectionList
sections={sections}
ItemSeparatorComponent={this.renderItemSeparator}
renderItem={this.renderItem}
renderSectionHeader={this.renderSectionHeader}
keyExtractor={this.keyExtractor}
keyboardShouldPersistTaps='always'
keyboardDismissMode='on-drag'
initialNumToRender={10}
maxToRenderPerBatch={10}
stickySectionHeadersEnabled={true}
scrollEventThrottle={100}
windowSize={5}
/>
</View>
);
};
@ -188,7 +190,6 @@ export default class ExtensionTeam extends PureComponent {
titleCancelColor={defaultTheme.centerChannelColor}
onChangeText={this.handleSearch}
autoCapitalize='none'
value={this.state.term}
/>
</View>
);