fix: remove default values from text inputs
This commit is contained in:
1 parent
bd09390fba
commit
714cb37a6e
5 files changed
+22
-11
No files matched your search
@@ -10,7 +10,7 @@
|
||||
|
||||
let {
|
||||
defaultValue = false,
|
||||
checked = $bindable(defaultValue),
|
||||
checked = $bindable(),
|
||||
labelClass = '',
|
||||
class: clazz = '',
|
||||
children,
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
let {
|
||||
label = undefined,
|
||||
value = $bindable(''),
|
||||
value = $bindable(),
|
||||
placeholder = '',
|
||||
disabled = false,
|
||||
required = false,
|
||||
|
||||
@@ -82,19 +82,27 @@
|
||||
>
|
||||
<Header pageHeader>{$t('routes.admin.config.title')}</Header>
|
||||
{#if formData}
|
||||
<TextInput bind:value={formData.name} label={$t('form.name')} />
|
||||
<TextInput
|
||||
bind:value={formData.description}
|
||||
bind:value={() => formData.name ?? '', (v) => (formData.description = v)}
|
||||
label={$t('form.name')}
|
||||
/>
|
||||
<TextInput
|
||||
bind:value={
|
||||
() => formData.description ?? '', (v) => (formData.description = v)
|
||||
}
|
||||
label={$t('form.description')}
|
||||
/>
|
||||
<MarkdownEditor
|
||||
previewButton
|
||||
bind:value={formData.sidebar}
|
||||
bind:value={() => formData.sidebar ?? '', (v) => (formData.sidebar = v)}
|
||||
label={$t('routes.admin.config.sidebar')}
|
||||
/>
|
||||
<MarkdownEditor
|
||||
previewButton
|
||||
bind:value={formData.legal_information}
|
||||
bind:value={
|
||||
() => formData.legal_information ?? '',
|
||||
(v) => (formData.legal_information = v)
|
||||
}
|
||||
label={$t('routes.legal.title')}
|
||||
/>
|
||||
<div class="flex flex-col gap-1">
|
||||
|
||||
@@ -434,9 +434,12 @@
|
||||
<CommentForm
|
||||
postId={data.post.post_view.post.id}
|
||||
oncomment={(comment) => {
|
||||
comments.comments.push(comment.comment_view)
|
||||
reloadComments()
|
||||
toast({ content: $t('routes.post.commented'), type: 'success' })
|
||||
Promise.resolve(data.comments).then((r) => {
|
||||
r.comments.push(comment.comment_view)
|
||||
})
|
||||
// comments.comments.push(comment.comment_view)
|
||||
// reloadComments()
|
||||
// toast({ content: $t('routes.post.commented'), type: 'success' })
|
||||
}}
|
||||
locked={(data.post.post_view.post.locked &&
|
||||
!(
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
let email: string | undefined = $state('')
|
||||
|
||||
run(() => {
|
||||
$effect(() => {
|
||||
if (email == '') email = undefined
|
||||
})
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
passwordVerify = $state(''),
|
||||
captcha: GetCaptchaResponse | null = $state(null),
|
||||
verifyCaptcha: string | undefined = $state(undefined),
|
||||
application: string | undefined = $state(undefined),
|
||||
application: string = $state(''),
|
||||
submitting: boolean = $state(false),
|
||||
honeypot: string | undefined = $state(undefined),
|
||||
nsfw: boolean = $state(false)
|
||||
|
||||
Reference in new issue
Block a user