From b04ed35c6d1a0f4b59188daefc8c02db3272aae9 Mon Sep 17 00:00:00 2001 From: Michael Ilie Date: Mon, 10 Aug 2020 09:21:05 -0400 Subject: [PATCH] Fixed weird search bar issue --- app/Clubs.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Clubs.js b/app/Clubs.js index f8a384c..1930a66 100644 --- a/app/Clubs.js +++ b/app/Clubs.js @@ -68,6 +68,9 @@ class Clubs extends React.Component { this.setState({ search:search }); ds = this.state.dataSearch.filter((thing)=>{return thing.name.startsWith(search)}) this.setState({dataSearch: ds}) + if (search == ""){ + this.setState({dataSearch:this.state.data}) + } }; clearSearch = (search)=>{ ds = this.state.data; @@ -84,6 +87,7 @@ class Clubs extends React.Component { lightTheme placeholder="Type Here..." onChangeText={this.updateSearch} + onCancel={this.clearSearch} onClear={this.clearSearch} value={this.state.search}/>