fix login input field to work with password managers #15

merged
opened by sapphic.moe targeting main from [deleted fork]: main

changed the id property from handle to username and added autocomplete="username" so password managers like 1password can play nicely

Changed files
+6 -3
src
components
+6 -3
src/components/login.tsx
···
return (
<form class="flex flex-col gap-y-2 px-1" onsubmit={(e) => e.preventDefault()}>
-
<label for="handle" class="hidden">
Add account
</label>
<div class="dark:bg-dark-100 dark:shadow-dark-700 flex grow items-center gap-2 rounded-lg border-[0.5px] border-neutral-300 bg-white px-2 shadow-xs focus-within:outline-[1px] focus-within:outline-neutral-600 dark:border-neutral-600 dark:focus-within:outline-neutral-400">
<label
-
for="handle"
class="iconify lucide--user-round-plus shrink-0 text-neutral-500 dark:text-neutral-400"
></label>
<input
type="text"
spellcheck={false}
placeholder="user.bsky.social"
-
id="handle"
class="grow py-1 select-none placeholder:text-sm focus:outline-none"
onInput={(e) => setLoginInput(e.currentTarget.value)}
/>
···
return (
<form class="flex flex-col gap-y-2 px-1" onsubmit={(e) => e.preventDefault()}>
+
<label for="username" class="hidden">
Add account
</label>
<div class="dark:bg-dark-100 dark:shadow-dark-700 flex grow items-center gap-2 rounded-lg border-[0.5px] border-neutral-300 bg-white px-2 shadow-xs focus-within:outline-[1px] focus-within:outline-neutral-600 dark:border-neutral-600 dark:focus-within:outline-neutral-400">
<label
+
for="username"
class="iconify lucide--user-round-plus shrink-0 text-neutral-500 dark:text-neutral-400"
></label>
<input
type="text"
spellcheck={false}
placeholder="user.bsky.social"
+
id="username"
+
name="username"
+
autocomplete="username"
+
aria-label="Your AT Protocol handle"
class="grow py-1 select-none placeholder:text-sm focus:outline-none"
onInput={(e) => setLoginInput(e.currentTarget.value)}
/>