summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-08-08 13:54:23 +0100
committerJoram Wilander <jwawilander@gmail.com>2017-08-08 08:54:23 -0400
commit7683e751ab7c8dee28e8ec8f2dcf3edd1048fe29 (patch)
tree16f6b3bca2238459ca165bea5d321b092ff3fb0b
parentdcaed2c8e3380a433e5b3b1a9a91edbd1de4be2f (diff)
downloadchat-7683e751ab7c8dee28e8ec8f2dcf3edd1048fe29.tar.gz
chat-7683e751ab7c8dee28e8ec8f2dcf3edd1048fe29.tar.bz2
chat-7683e751ab7c8dee28e8ec8f2dcf3edd1048fe29.zip
PLT-7311 Don't allow empty search in searchbar. (#7133)
-rw-r--r--webapp/components/search_bar.jsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx
index f2fed25ca..581fe0536 100644
--- a/webapp/components/search_bar.jsx
+++ b/webapp/components/search_bar.jsx
@@ -173,6 +173,10 @@ export default class SearchBar extends React.Component {
e.preventDefault();
const terms = this.state.searchTerm.trim();
+ if (terms.length === 0) {
+ return;
+ }
+
AppDispatcher.handleServerAction({
type: ActionTypes.RECEIVED_SEARCH_TERM,
term: terms,