From 70fd5761d4b44ca8ecf8f2066a7fd3c970c2cfa1 Mon Sep 17 00:00:00 2001 From: Oleg Ivaniv Date: Thu, 5 Sep 2024 13:21:30 +0200 Subject: [PATCH] fix(editor): Auto-focus expression input when switching from "fixed" mode --- 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 c1f2de10dcff9..b5ca14dd887fd 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();