From c2be6497ebc3dd586f4fbd61f76ac6cef23a9acf Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Fri, 9 Dec 2016 18:43:50 -0500
Subject: Changed SuggestionBox to clear suggestions shortly after losing focus
 (#4721)

---
 webapp/components/suggestion/suggestion_list.jsx | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'webapp/components/suggestion/suggestion_list.jsx')

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
-};
-- 
cgit v1.2.3-1-g7c22

