fix: improve MultiSelectWrapper behavior

This commit is contained in:
Ruben Fiszel
2025-05-04 18:18:58 +02:00
parent d2ad2cdf33
commit 36da8aec08
4 changed files with 13 additions and 8 deletions
@@ -293,7 +293,7 @@
tooltip="This event is triggered when the script runs successfully."
items={Object.keys($runnableComponents).filter((_id) => _id !== id)}
bind:value={
() => hiddenInlineScript.script.recomputeIds,
() => hiddenInlineScript.script.recomputeIds ?? [],
(v) => {
if ($app.hiddenInlineScripts[hiddenInlineScript.index]) {
$app.hiddenInlineScripts[hiddenInlineScript.index].recomputeIds = v
@@ -4,12 +4,15 @@
import MultiSelect from '$lib/components/multiselect/MultiSelectWrapper.svelte'
import { twMerge } from 'tailwind-merge'
export let items: string[]
export let value: string[] | undefined = undefined
export let title: string
export let tooltip: string
let width = 0
let { items, value = $bindable(), title, tooltip } = $props<{
items: string[]
value: string[] | undefined
title: string
tooltip: string
}>()
let width = $state(0)
const inputWidth = 280
</script>
@@ -9,7 +9,7 @@
let {
items,
value = $bindable([]),
value = $bindable(),
placeholder = undefined,
target = undefined,
topPlacement = false,
@@ -23,6 +23,8 @@
allowUserOptions?: boolean | 'append'
}>()
$effect.pre(() => { if (value === undefined) value = [] })
const [floatingRef, floatingContent] = createFloatingActions({
strategy: 'absolute',
placement: topPlacement ? 'top-start' : 'bottom-start',
@@ -133,7 +133,7 @@
} else {
await goto(rd ?? '/')
}
console.log('Workspace selected, going to', rd)
console.log('Workspace selected going to ' + (rd ? `rd: ${rd}` : 'home'))
} catch (e) {
console.error('Error going to', rd, e)
window.location.reload()