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