fix path bind

This commit is contained in:
Ruben Fiszel
2025-06-13 06:47:05 +02:00
parent 24e3ba20ef
commit 4bd89b3883
+12 -3
View File
@@ -72,8 +72,8 @@
fullNamePlaceholder = undefined,
namePlaceholder = '',
initialPath,
path = $bindable(''),
error = $bindable(''),
path = $bindable(undefined),
error = $bindable(undefined),
disabled = $bindable(false),
checkInitialPathExistence = false,
autofocus = true,
@@ -83,6 +83,15 @@
disableEditing = false
}: Props = $props()
$effect.pre(() => {
if (path == undefined) {
path = ''
}
if (error == undefined) {
error = ''
}
})
let inputP: HTMLInputElement | undefined = $state(undefined)
const dispatch = createEventDispatcher()
@@ -165,7 +174,7 @@
meta = newMeta
path = metaToPath(meta)
} else {
meta = pathToMeta(path, hideUser)
meta = pathToMeta(path ?? '', hideUser)
}
}