fix(Sqllab): Autocomplete got stuck in UI when open it too fast (#33522)

This commit is contained in:
Rafael Benitez
2025-05-20 10:38:55 -04:00
committed by GitHub
parent ca9e74edd8
commit b4e2406385

View File

@@ -325,6 +325,8 @@ const SqlEditor: FC<Props> = ({
const SqlFormExtension = extensionsRegistry.get('sqleditor.extension.form');
const isTempId = (value: unknown): boolean => Number.isNaN(Number(value));
const startQuery = useCallback(
(ctasArg = false, ctas_method = CtasEnum.Table) => {
if (!database) {
@@ -915,7 +917,7 @@ const SqlEditor: FC<Props> = ({
)}
{isActive && (
<AceEditorWrapper
autocomplete={autocompleteEnabled}
autocomplete={autocompleteEnabled && !isTempId(queryEditor.id)}
onBlur={onSqlChanged}
onChange={onSqlChanged}
queryEditorId={queryEditor.id}