diff --git a/src/views/components/InputBuilderSelect.svelte b/src/views/components/InputBuilderSelect.svelte index 3ab5fc4d..4b3ab7ab 100644 --- a/src/views/components/InputBuilderSelect.svelte +++ b/src/views/components/InputBuilderSelect.svelte @@ -17,6 +17,16 @@ export let is_multi: boolean; $: id = `builder_select_${index}`; $: options_id = `builder_select_options_btn_${index}`; + + function moveOption(from: number, direction: "up" | "down") { + const to = direction === "up" ? from - 1 : from + 1; + if (to < 0 || to >= options.length) return; + const tmp = options[from] + options[from] = options[to] + options[to] = tmp; + options = options; + notifyChange(); + } @@ -42,6 +52,30 @@ {#each options || [] as option, idx} {@const value_id = `${options_id}_option_${idx}`}