diff --git a/app/client/src/components/editorComponents/DynamicAutocompleteInput.tsx b/app/client/src/components/editorComponents/DynamicAutocompleteInput.tsx index 9a161a4701..5b0a833027 100644 --- a/app/client/src/components/editorComponents/DynamicAutocompleteInput.tsx +++ b/app/client/src/components/editorComponents/DynamicAutocompleteInput.tsx @@ -180,6 +180,7 @@ type Props = ReduxStateProps & type State = { isFocused: boolean; + autoCompleteVisible: boolean; }; class DynamicAutocompleteInput extends Component { @@ -190,6 +191,7 @@ class DynamicAutocompleteInput extends Component { super(props); this.state = { isFocused: false, + autoCompleteVisible: false, }; } @@ -319,7 +321,14 @@ class DynamicAutocompleteInput extends Component { const shouldShow = cursorBetweenBinding && !cm.state.completionActive; if (shouldShow) { AnalyticsUtil.logEvent("AUTO_COMPELTE_SHOW", {}); + this.setState({ + autoCompleteVisible: true, + }); cm.showHint(cm); + } else { + this.setState({ + autoCompleteVisible: false, + }); } } }; @@ -345,7 +354,8 @@ class DynamicAutocompleteInput extends Component { const hasError = !!(meta && meta.error); let showError = false; if (this.editor) { - showError = hasError && this.state.isFocused; + showError = + hasError && this.state.isFocused && !this.state.autoCompleteVisible; } return (