diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-12-09 18:43:50 -0500 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-12-09 15:43:50 -0800 |
commit | c2be6497ebc3dd586f4fbd61f76ac6cef23a9acf (patch) | |
tree | d1f20596f4a7d632ab69ece0c419229737c2d185 /webapp/components/suggestion/suggestion_list.jsx | |
parent | 65699c7c51c7fed17979d7c47fff3e2231d395bd (diff) | |
download | chat-c2be6497ebc3dd586f4fbd61f76ac6cef23a9acf.tar.gz chat-c2be6497ebc3dd586f4fbd61f76ac6cef23a9acf.tar.bz2 chat-c2be6497ebc3dd586f4fbd61f76ac6cef23a9acf.zip |
Changed SuggestionBox to clear suggestions shortly after losing focus (#4721)
Diffstat (limited to 'webapp/components/suggestion/suggestion_list.jsx')
-rw-r--r-- | webapp/components/suggestion/suggestion_list.jsx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/webapp/components/suggestion/suggestion_list.jsx b/webapp/components/suggestion/suggestion_list.jsx index 0c2dbf784..18d45242a 100644 --- a/webapp/components/suggestion/suggestion_list.jsx +++ b/webapp/components/suggestion/suggestion_list.jsx @@ -10,6 +10,16 @@ import {FormattedMessage} from 'react-intl'; import React from 'react'; export default class SuggestionList extends React.Component { + static propTypes = { + suggestionId: React.PropTypes.string.isRequired, + location: React.PropTypes.string, + renderDividers: React.PropTypes.bool + }; + + static defaultProps = { + renderDividers: false + }; + constructor(props) { super(props); @@ -65,7 +75,7 @@ export default class SuggestionList extends React.Component { scrollToItem(term) { const content = this.getContent(); - if (!content) { + if (!content || content.length === 0) { return; } @@ -153,13 +163,3 @@ export default class SuggestionList extends React.Component { ); } } - -SuggestionList.propTypes = { - suggestionId: React.PropTypes.string.isRequired, - location: React.PropTypes.string, - renderDividers: React.PropTypes.bool -}; - -SuggestionList.defaultProps = { - renderDividers: false -}; |