Skip to content

Commit a485391

Browse files
authored
fix: set initial value as empty string on free text search (#178)
Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
1 parent a5351e4 commit a485391

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/free-text-search/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FreeTextSearch extends React.Component {
2525
this.onChange = this.onChange.bind(this);
2626

2727
this.state = {
28-
value: props.value,
28+
value: props.value || "",
2929
};
3030
}
3131

@@ -46,7 +46,7 @@ class FreeTextSearch extends React.Component {
4646
this.setState({value: ''});
4747
}
4848

49-
doFiltering(term){
49+
doFiltering(term = ""){
5050
this.props.onSearch(term.trim());
5151
}
5252

@@ -95,6 +95,7 @@ class FreeTextSearch extends React.Component {
9595
FreeTextSearch.defaultProps = {
9696
preventEvents: false,
9797
onChange: null,
98+
value: "",
9899
}
99100

100101
FreeTextSearch.propTypes = {

0 commit comments

Comments
 (0)