diff options
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/search_bar.jsx | 6 | ||||
-rw-r--r-- | webapp/components/suggestion/suggestion_box.jsx | 1 |
2 files changed, 7 insertions, 0 deletions
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' diff --git a/webapp/components/suggestion/suggestion_box.jsx b/webapp/components/suggestion/suggestion_box.jsx index 6126a16a0..2c358b693 100644 --- a/webapp/components/suggestion/suggestion_box.jsx +++ b/webapp/components/suggestion/suggestion_box.jsx @@ -172,6 +172,7 @@ export default class SuggestionBox extends React.Component { e.preventDefault(); } else if (e.which === KeyCodes.ENTER || e.which === KeyCodes.TAB) { GlobalActions.emitCompleteWordSuggestion(this.suggestionId); + this.props.onKeyDown(e); e.preventDefault(); } else if (e.which === KeyCodes.ESCAPE) { GlobalActions.emitClearSuggestions(this.suggestionId); |