From 28cebd42d0b50d968b4fa2678425d4a378f9dd00 Mon Sep 17 00:00:00 2001 From: Danielo Rodriguez Date: Sun, 22 Oct 2023 16:07:41 +0200 Subject: [PATCH] fix: proper duplicate scroll --- src/views/FormBuilder.svelte | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/views/FormBuilder.svelte b/src/views/FormBuilder.svelte index cff98fe6..b4290c77 100644 --- a/src/views/FormBuilder.svelte +++ b/src/views/FormBuilder.svelte @@ -81,11 +81,8 @@ input: structuredClone(field.input), name: findFreeName(fieldIndex), }; - definition.fields = [ - ...definition.fields.slice(0, fieldIndex + 1), - newField, - ...definition.fields.slice(fieldIndex + 1), - ]; + definition.fields.splice(fieldIndex + 1, 0, newField); + definition.fields = definition.fields; onChange(); activeFieldIndex = fieldIndex + 1; }