Skip to content

Commit

Permalink
Update inputes to be selected when label clicked (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Smith authored Mar 1, 2023
1 parent 32d5d0e commit e1fa4ee
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/polite-mirrors-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@supabase/auth-ui-react': patch
'@supabase/auth-ui-svelte': patch
---

Update forms to select input when label is pressed
2 changes: 2 additions & 0 deletions packages/react/src/components/Auth/interfaces/EmailAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function EmailAuth({
{labels?.email_label}
</Label>
<Input
id="email"
type="email"
name="email"
placeholder={labels?.email_input_placeholder}
Expand All @@ -168,6 +169,7 @@ function EmailAuth({
{labels?.password_label}
</Label>
<Input
id="password"
type="password"
name="password"
placeholder={labels?.password_input_placeholder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ function ForgottenPassword({
{labels?.email_label}
</Label>
<Input
id="email"
name="email"
type="email"
placeholder={labels?.email_input_placeholder}
Expand Down
5 changes: 4 additions & 1 deletion packages/react/src/components/Auth/interfaces/MagicLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ function MagicLink({
<Container gap="large" direction="vertical" appearance={appearance}>
<Container gap="large" direction="vertical" appearance={appearance}>
<div>
<Label appearance={appearance}>{labels?.email_input_label}</Label>
<Label htmlFor="email" appearance={appearance}>
{labels?.email_input_label}
</Label>
<Input
id="email"
name="email"
type="email"
placeholder={labels?.email_input_placeholder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function UpdatePassword({
{labels?.password_label}
</Label>
<Input
id="password"
name="password"
placeholder={labels?.password_label}
type="password"
Expand Down
12 changes: 11 additions & 1 deletion packages/svelte/src/lib/Auth/interfaces/EmailAuth.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,23 @@
<Container direction="vertical" gap="large" {appearance}>
<div>
<Label for="email" {appearance}>{i18n?.[$authView]?.email_label}</Label>
<Input type="email" name="email" bind:value={email} autocomplete="email" {appearance} />
<Input
id="email"
type="email"
name="email"
placeholder={i18n?.[$authView]?.email_input_placeholder}
bind:value={email}
autocomplete="email"
{appearance}
/>
</div>
<div>
<Label for="password" {appearance}>{i18n?.[$authView]?.password_label}</Label>
<Input
id="password"
type="password"
name="password"
placeholder={i18n?.[$authView]?.password_input_placeholder}
bind:value={password}
autocomplete={$authView === VIEWS.SIGN_IN ? 'current-password' : 'new-password'}
{appearance}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@
<Container direction="vertical" gap="large" {appearance}>
<div>
<Label for="email" {appearance}>{i18n?.forgotten_password?.email_label}</Label>
<Input type="email" name="email" bind:value={email} autocomplete="email" {appearance} />
<Input
id="email"
type="email"
name="email"
placeholder={i18n?.forgotten_password?.email_input_placeholder}
bind:value={email}
autocomplete="email"
{appearance}
/>
</div>
<Button type="submit" color="primary" {loading} {appearance}>
{i18n?.forgotten_password?.button_label}
Expand Down
1 change: 1 addition & 0 deletions packages/svelte/src/lib/Auth/interfaces/MagicLink.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<div>
<Label for="email" {appearance}>{i18n?.magic_link?.email_input_label}</Label>
<Input
id="email"
type="email"
name="email"
placeholder={i18n?.magic_link?.email_input_placeholder}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
{i18n?.update_password?.password_label}
</Label>
<Input
id="email"
type="email"
placeholder={i18n?.update_password?.password_label}
name="email"
Expand Down

0 comments on commit e1fa4ee

Please sign in to comment.