From 97d3e2827282e1692018e1d9274cb722b52a01c5 Mon Sep 17 00:00:00 2001 From: acondal Date: Mon, 30 Sep 2024 13:29:40 +0200 Subject: [PATCH] fix: check if extraParams are really changing --- .../components/snippet-config-extra-params.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/x-components/src/x-modules/extra-params/components/snippet-config-extra-params.vue b/packages/x-components/src/x-modules/extra-params/components/snippet-config-extra-params.vue index b62ed09319..c3715848a6 100644 --- a/packages/x-components/src/x-modules/extra-params/components/snippet-config-extra-params.vue +++ b/packages/x-components/src/x-modules/extra-params/components/snippet-config-extra-params.vue @@ -35,16 +35,25 @@ }, setup(props) { const snippetConfig = inject('snippetConfig') as SnippetConfig; - const extraParams = ref({}); + const extraParams = ref>({}); + const initialExtraParams = ref>({}); watch( [() => snippetConfig, () => props.values], () => { + const newExtraParams: Record = {}; + forEach({ ...props.values, ...snippetConfig }, (name, value) => { if (!props.excludedExtraParams.includes(name)) { - extraParams.value = { ...extraParams.value, [name]: value }; + newExtraParams[name] = value; } }); + + // Check if extraParams are really changing to avoid event emission if they don't + if (JSON.stringify(newExtraParams) !== JSON.stringify(initialExtraParams.value)) { + extraParams.value = newExtraParams; + initialExtraParams.value = newExtraParams; + } }, { deep: true,