Fix for GraphQL - now autocomplete does not reset anymore (#3468)

This commit is contained in:
Giuseppe B 2021-08-02 12:12:58 +02:00 committed by GitHub
parent 70d5797d94
commit bae8195dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -928,7 +928,7 @@ class CodeEditor extends Component<Props, State> {
_codemirrorEndCompletion() {
if (this._autocompleteDebounce !== null) {
clearInterval(this._autocompleteDebounce);
clearTimeout(this._autocompleteDebounce);
}
}
@ -944,6 +944,13 @@ class CodeEditor extends Component<Props, State> {
if (this._autocompleteDebounce !== null) {
clearTimeout(this._autocompleteDebounce);
}
// You don't want to re-trigger the hint dropdown if it's already open
// for other reasons, like forcing its display with Ctrl+Space
if (this.codeMirror?.isHintDropdownActive()) {
return;
}
this._autocompleteDebounce = setTimeout(() => {
doc.execCommand('autocomplete');
}, 700);