From 2c503f9b0333b668730c4eb11deb5184ee49f295 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Wed, 2 Apr 2025 23:46:48 +0200 Subject: [PATCH] feat: improve registration flow --- src/routes/Register.svelte | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/routes/Register.svelte b/src/routes/Register.svelte index 4e397ab..b445da9 100644 --- a/src/routes/Register.svelte +++ b/src/routes/Register.svelte @@ -110,6 +110,7 @@ { if (e.keyCode === 13) { + e.preventDefault(); document.getElementById('lastname')?.focus(); } if (e.keyCode === 40) { @@ -120,7 +121,7 @@ autocomplete="one-time-code" id="firstname" name="firstname" - class="placeholder:text-black dark:placeholder:text-white py-3 px-4 block w-full border-gray-500 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-200 dark:text-gray-400 border" + class="font-semibold placeholder:font-normal placeholder:text-black dark:placeholder:text-gray-200 py-3 px-4 block w-full border-gray-500 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-200 dark:text-white border" required placeholder="Vorname" bind:value={firstname} @@ -160,8 +161,8 @@
{ - console.log(e.keyCode); if (e.keyCode === 13) { + e.preventDefault(); document.getElementById('email')?.focus(); } if (e.keyCode === 38) { @@ -175,7 +176,7 @@ type="lastname" id="lastname" name="lastname" - class="placeholder:text-black dark:placeholder:text-white py-3 px-4 block w-full border-gray-500 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-200 dark:text-gray-400 border" + class="font-semibold placeholder:font-normal placeholder:text-black dark:placeholder:text-gray-200 py-3 px-4 block w-full border-gray-500 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-200 dark:text-white border" required placeholder="Nachname" aria-describedby="lastname-error" @@ -217,8 +218,8 @@
{ - console.log(e.keyCode); if (e.keyCode === 13) { + e.preventDefault(); document.getElementById('submit')?.focus(); } if (e.keyCode === 38) { @@ -232,7 +233,7 @@ type="email" id="email" name="email" - class="placeholder:text-black dark:placeholder:text-white py-3 px-4 block w-full border-gray-500 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-200 dark:text-gray-400 border" + class="font-semibold placeholder:font-normal placeholder:text-black dark:placeholder:text-gray-200 py-3 px-4 block w-full border-gray-500 rounded-md focus:border-blue-500 focus:ring-blue-500 dark:bg-gray-800 dark:border-gray-200 dark:text-white border" placeholder="E-Mail (optional)" aria-describedby="lastname-error" bind:value={email} @@ -266,6 +267,11 @@