From 7f68a60f8c228d5604e0566bf84cabb145d16c37 Mon Sep 17 00:00:00 2001
From: Christopher Speller <crspeller@gmail.com>
Date: Mon, 24 Apr 2017 13:10:34 -0400
Subject: Fixing double enter in channel switcher (#6208)

---
 webapp/components/search_bar.jsx | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'webapp/components/search_bar.jsx')

diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx
index 527f965c7..23f7d1762 100644
--- a/webapp/components/search_bar.jsx
+++ b/webapp/components/search_bar.jsx
@@ -36,6 +36,7 @@ export default class SearchBar extends React.Component {
         this.handleSubmit = this.handleSubmit.bind(this);
         this.searchMentions = this.searchMentions.bind(this);
         this.getFlagged = this.getFlagged.bind(this);
+        this.handleKeyDown = this.handleKeyDown.bind(this);
 
         const state = this.getSearchTermStateFromStores();
         state.focused = false;
@@ -107,6 +108,10 @@ export default class SearchBar extends React.Component {
         });
     }
 
+    handleKeyDown() {
+        // This is just to prevent a JS error
+    }
+
     handleChange(e) {
         var term = e.target.value;
         SearchStore.storeSearchTerm(term);
@@ -320,6 +325,7 @@ export default class SearchBar extends React.Component {
                         onFocus={this.handleUserFocus}
                         onBlur={this.handleUserBlur}
                         onChange={this.handleChange}
+                        onKeyDown={this.handleKeyDown}
                         listComponent={SearchSuggestionList}
                         providers={this.suggestionProviders}
                         type='search'
-- 
cgit v1.2.3-1-g7c22

