summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-06-05 20:43:59 +0800
committerHarrison Healey <harrisonmhealey@gmail.com>2017-06-05 08:43:59 -0400
commitfd6f6a55ceb38f4ecf105a50464fb1a57226c947 (patch)
treef5e8c6db335290879edc2dadc34bf1bc303eeecd /webapp
parent14f47f569fdc00124913a7ea513ebea684393396 (diff)
downloadchat-fd6f6a55ceb38f4ecf105a50464fb1a57226c947.tar.gz
chat-fd6f6a55ceb38f4ecf105a50464fb1a57226c947.tar.bz2
chat-fd6f6a55ceb38f4ecf105a50464fb1a57226c947.zip
[PLT-6616] Fixed autocomplete to close properly (#6528)
* fix autocomplete to close properly * disable key press of suggestion box when input value is empty
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/suggestion/suggestion_box.jsx16
1 files changed, 9 insertions, 7 deletions
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 (
<div ref='container'>
{textbox}
- <SuggestionListComponent
- suggestionId={this.suggestionId}
- location={listStyle}
- renderDividers={renderDividers}
- onCompleteWord={this.handleCompleteWord}
- />
+ {this.props.value &&
+ <SuggestionListComponent
+ suggestionId={this.suggestionId}
+ location={listStyle}
+ renderDividers={renderDividers}
+ onCompleteWord={this.handleCompleteWord}
+ />
+ }
</div>
);
}