From 54ab2b14e41fe84a455c7e7d5c73d7347844d2fb Mon Sep 17 00:00:00 2001 From: oleg Date: Fri, 6 Sep 2024 09:17:46 +0200 Subject: [PATCH] fix(editor): Auto-focus expression input when switching from "fixed" mode (#10686) --- packages/editor-ui/src/components/ParameterInput.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue index c1f2de10dc..b5ca14dd88 100644 --- a/packages/editor-ui/src/components/ParameterInput.vue +++ b/packages/editor-ui/src/components/ParameterInput.vue @@ -941,6 +941,14 @@ watch(remoteParameterOptionsLoading, () => { tempValue.value = displayValue.value as string; }); +// Focus input field when changing from fixed value to expression +watch(isModelValueExpression, async (isExpression, wasExpression) => { + if (isExpression && !wasExpression) { + await nextTick(); + inputField.value?.focus(); + } +}); + onUpdated(async () => { await nextTick();