From 9f56a335b7fbe5d40274f9539248b9fac502fbbb Mon Sep 17 00:00:00 2001 From: eefano <77832+eefano@users.noreply.github.com> Date: Tue, 5 Mar 2024 21:41:11 +0100 Subject: [PATCH] little fix for withVal --- packages/core/controls.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/controls.mjs b/packages/core/controls.mjs index 9b1b8c0d..f3960527 100644 --- a/packages/core/controls.mjs +++ b/packages/core/controls.mjs @@ -15,7 +15,7 @@ export function createParam(names) { let bag; // check if we have an object with an unnamed control (.value) if (typeof xs === 'object' && xs.value !== undefined) { - bag = xs; // grab props that are already there + bag = { ...xs }; // grab props that are already there xs = xs.value; // grab the unnamed control for this one delete bag.value; } @@ -28,7 +28,8 @@ export function createParam(names) { }); return result; } else if (bag) { - return { ...bag, [name]: xs }; + bag[name] = xs; + return bag; } else { return { [name]: xs }; }