fix timeline search with empty text box should do nothing (#8262)

* fix timeline search with empty text box should do nothing

* test SearchBar component

* fix lint error

* Update SearchBar-test.tsx

Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
Emmanuel 2022-05-02 02:09:59 +01:00 committed by GitHub
parent cea75fde27
commit d294dad04d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 135 additions and 0 deletions

View file

@ -78,6 +78,7 @@ export default class SearchBar extends React.Component<IProps, IState> {
}
private onSearch = (): void => {
if (!this.searchTerm.current.value.trim()) return;
this.props.onSearch(this.searchTerm.current.value, this.state.scope);
};