Skip to content
Snippets Groups Projects
Commit 8cf8ce4a authored by Sorin Davidoi's avatar Sorin Davidoi Committed by Eugen Rochko
Browse files

fix(components/autosuggest_textarea): Race condition regarding onBlur (#3631)

parent 0f1b1d78
No related branches found
No related tags found
No related merge requests found
......@@ -124,13 +124,7 @@ class AutosuggestTextarea extends ImmutablePureComponent {
}
onBlur = () => {
// If we hide the suggestions immediately, then this will prevent the
// onClick for the suggestions themselves from firing.
// Setting a short window for that to take place before hiding the
// suggestions ensures that can't happen.
setTimeout(() => {
this.setState({ suggestionsHidden: true });
}, 100);
this.setState({ suggestionsHidden: true });
}
onSuggestionClick = (e) => {
......@@ -191,7 +185,7 @@ class AutosuggestTextarea extends ImmutablePureComponent {
key={suggestion}
data-index={suggestion}
className={`autosuggest-textarea__suggestions__item ${i === selectedSuggestion ? 'selected' : ''}`}
onClick={this.onSuggestionClick}
onMouseDown={this.onSuggestionClick}
>
<AutosuggestAccountContainer id={suggestion} />
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment