[PLT-6616] Fixed autocomplete to close properly (#6528)
* fix autocomplete to close properly * disable key press of suggestion box when input value is empty
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
14f47f569f
Коммит
fd6f6a55ce
@@ -237,7 +237,7 @@ export default class SuggestionBox extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleKeyDown(e) {
|
handleKeyDown(e) {
|
||||||
if (SuggestionStore.hasSuggestions(this.suggestionId)) {
|
if (this.props.value && SuggestionStore.hasSuggestions(this.suggestionId)) {
|
||||||
if (e.which === KeyCodes.UP) {
|
if (e.which === KeyCodes.UP) {
|
||||||
GlobalActions.emitSelectPreviousSuggestion(this.suggestionId);
|
GlobalActions.emitSelectPreviousSuggestion(this.suggestionId);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -330,12 +330,14 @@ export default class SuggestionBox extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div ref='container'>
|
<div ref='container'>
|
||||||
{textbox}
|
{textbox}
|
||||||
|
{this.props.value &&
|
||||||
<SuggestionListComponent
|
<SuggestionListComponent
|
||||||
suggestionId={this.suggestionId}
|
suggestionId={this.suggestionId}
|
||||||
location={listStyle}
|
location={listStyle}
|
||||||
renderDividers={renderDividers}
|
renderDividers={renderDividers}
|
||||||
onCompleteWord={this.handleCompleteWord}
|
onCompleteWord={this.handleCompleteWord}
|
||||||
/>
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user