From 42868fc2e612f54c77ce1cef9f9413ca8dc77036 Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sun, 16 Aug 2026 11:31:27 +0200 Subject: [PATCH] feat(login): reveal-password toggle, and stop the keyboard editing credentials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an eye/eye-off button inside the password field so a typed password can be checked against what was intended — the difference between "wrong password" and "wrong keyboard" was previously invisible. `bind:value` is not allowed alongside a dynamic `type`, so the field is wired manually via value/oninput; unlike branching on two separate inputs, this keeps focus and caret position when the toggle is pressed. Both fields also get autocapitalize/autocorrect/spellcheck off and proper autocomplete hints. The Android soft keyboard was free to capitalise or autocorrect the username, which silently changes a credential the user believes they typed correctly. --- src/routes/login/+page.svelte | 50 +++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 62fe1066..00e87d01 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -7,6 +7,7 @@ let serverName = $state(""); let username = $state(""); let password = $state(""); + let showPassword = $state(false); let connecting = $state(false); let loggingIn = $state(false); let localError = $state(null); @@ -146,6 +147,10 @@ type="text" bind:value={username} placeholder="Enter your username" + autocapitalize="none" + autocorrect="off" + autocomplete="username" + spellcheck="false" class="w-full px-4 py-3 bg-[var(--color-surface)] border border-gray-700 rounded-lg focus:outline-none focus:border-[var(--color-jellyfin)] text-white placeholder-gray-500" disabled={loggingIn} /> @@ -155,14 +160,43 @@ - +
+ + (password = e.currentTarget.value)} + placeholder="Enter your password" + autocapitalize="none" + autocorrect="off" + autocomplete="current-password" + spellcheck="false" + class="w-full pl-4 pr-12 py-3 bg-[var(--color-surface)] border border-gray-700 rounded-lg focus:outline-none focus:border-[var(--color-jellyfin)] text-white placeholder-gray-500" + disabled={loggingIn} + /> + +
{#if localError || $authError}