Fixed search results not showing

This commit is contained in:
Arnaud Vergnet 2020-04-16 11:55:18 +02:00
parent 9baaed9f6a
commit b2d7cf61cc
2 changed files with 6 additions and 1 deletions

View file

@ -49,6 +49,7 @@ class GroupListAccordion extends React.Component<Props, State> {
renderItem = ({item}: Object) => {
if (stringMatchQuery(item.name, this.props.currentSearchString)) {
const onPress = () => this.props.onGroupPress(item);
const onStartPress = () => this.props.onFavoritePress(item);
return (
@ -80,6 +81,9 @@ class GroupListAccordion extends React.Component<Props, State> {
render() {
const item = this.props.item;
console.log("=====================================================");
console.log(this.props.currentSearchString);
console.log(this.state.expanded);
return (
<List.Accordion
title={item.name}
@ -106,7 +110,7 @@ class GroupListAccordion extends React.Component<Props, State> {
keyExtractor={this.keyExtractor}
listKey={item.id}
// Performance props, see https://reactnative.dev/docs/optimizing-flatlist-configuration
getItemLayout={this.itemLayout}
// getItemLayout={this.itemLayout} // Broken with search
removeClippedSubviews={true}
/>
</List.Accordion>

View file

@ -80,6 +80,7 @@ class GroupSelectionScreen extends React.Component<Props, State> {
* @param str The new search string
*/
onSearchStringChange = (str: string) => {
console.log('search');
this.setState({currentSearchString: str})
};