Skip to content

Commit

Permalink
Set required on required form inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
eyeseast committed Oct 3, 2024
1 parent d1f7243 commit b34219b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/forms/Edit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Usually this will be rendered inside a modal, but it doesn't have to be.
<Flex direction="column" gap={1}>
<!-- Add any header and messaging using this slot -->
<slot />
<Field title={$_("edit.fields.title")}>
<Field title={$_("edit.fields.title")} required>
<Text name="title" value={document.title} required autofocus />
</Field>
<Field
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/forms/EditNote.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Positioning and generating coordinates should happen outside of this form.
name="title"
placeholder={$_("annotate.fields.title")}
bind:value={note.title}
required
/>
</Field>
<Field title={$_("annotate.fields.content")}>
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/forms/EditProject.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Edit project metadata
name="title"
placeholder={$_("projects.fields.title")}
value={project.title}
required
/>
</Field>
<Field title={$_("projects.fields.description")}>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/forms/ManageCollaborators.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ They might get separated later.
<h2>{$_("collaborators.addCollaborators")}</h2>
<p>{@html $_("collaborators.invite")}</p>
<Flex align="center">
<Field title={$_("common.emailAddress")} sronly>
<Text name="email" placeholder={$_("common.emailAddress")} />
<Field title={$_("common.emailAddress")} sronly required>
<Text name="email" placeholder={$_("common.emailAddress")} required />
</Field>
<Field>
<select name="access" class="access">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/forms/Projects.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ and we don't want to do that everywhere.
<form method="post" action="/projects/" use:enhance={onSubmit}>
<h2>{$_("projects.create")}</h2>
<Field title={$_("projects.fields.title")} required inline>
<Text name="title" placeholder={$_("projects.fields.title")} />
<Text name="title" placeholder={$_("projects.fields.title")} required />
</Field>

<details>
Expand Down

0 comments on commit b34219b

Please sign in to comment.