From fd6f6a55ceb38f4ecf105a50464fb1a57226c947 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Mon, 5 Jun 2017 20:43:59 +0800 Subject: [PLT-6616] Fixed autocomplete to close properly (#6528) * fix autocomplete to close properly * disable key press of suggestion box when input value is empty --- webapp/components/suggestion/suggestion_box.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/suggestion/suggestion_box.jsx b/webapp/components/suggestion/suggestion_box.jsx index e1de927b9..a8ee25db9 100644 --- a/webapp/components/suggestion/suggestion_box.jsx +++ b/webapp/components/suggestion/suggestion_box.jsx @@ -237,7 +237,7 @@ export default class SuggestionBox extends React.Component { } handleKeyDown(e) { - if (SuggestionStore.hasSuggestions(this.suggestionId)) { + if (this.props.value && SuggestionStore.hasSuggestions(this.suggestionId)) { if (e.which === KeyCodes.UP) { GlobalActions.emitSelectPreviousSuggestion(this.suggestionId); e.preventDefault(); @@ -330,12 +330,14 @@ export default class SuggestionBox extends React.Component { return (
{textbox} - + {this.props.value && + + }
); } -- cgit v1.2.3-1-g7c22