ui: plan 01-27 done #1
@@ -18,6 +18,15 @@
|
|||||||
let pending = $state(false);
|
let pending = $state(false);
|
||||||
let error: string | null = $state(null);
|
let error: string | null = $state(null);
|
||||||
|
|
||||||
|
// Safari ignores `autocomplete="off"` on type=email / login-shaped
|
||||||
|
// fields and pops the Keychain suggester regardless. The classic
|
||||||
|
// workaround is to render the input as `readonly` initially —
|
||||||
|
// Safari does not autofill readonly fields — and drop the
|
||||||
|
// attribute on the first user focus so typing still works. Once
|
||||||
|
// dropped, the flag stays false for the rest of the page life.
|
||||||
|
let emailReadonly = $state(true);
|
||||||
|
let codeReadonly = $state(true);
|
||||||
|
|
||||||
function describe(err: unknown): string {
|
function describe(err: unknown): string {
|
||||||
if (err instanceof AuthError) {
|
if (err instanceof AuthError) {
|
||||||
return err.message;
|
return err.message;
|
||||||
@@ -183,10 +192,12 @@
|
|||||||
<input
|
<input
|
||||||
type="email"
|
type="email"
|
||||||
name="galaxy-login-email"
|
name="galaxy-login-email"
|
||||||
autocomplete="off"
|
autocomplete="new-password"
|
||||||
autocorrect="off"
|
autocorrect="off"
|
||||||
autocapitalize="off"
|
autocapitalize="off"
|
||||||
spellcheck="false"
|
spellcheck="false"
|
||||||
|
readonly={emailReadonly}
|
||||||
|
onfocus={() => (emailReadonly = false)}
|
||||||
bind:value={email}
|
bind:value={email}
|
||||||
disabled={pending}
|
disabled={pending}
|
||||||
required
|
required
|
||||||
@@ -216,10 +227,12 @@
|
|||||||
type="text"
|
type="text"
|
||||||
name="galaxy-login-code"
|
name="galaxy-login-code"
|
||||||
inputmode="numeric"
|
inputmode="numeric"
|
||||||
autocomplete="off"
|
autocomplete="new-password"
|
||||||
autocorrect="off"
|
autocorrect="off"
|
||||||
autocapitalize="off"
|
autocapitalize="off"
|
||||||
spellcheck="false"
|
spellcheck="false"
|
||||||
|
readonly={codeReadonly}
|
||||||
|
onfocus={() => (codeReadonly = false)}
|
||||||
bind:value={code}
|
bind:value={code}
|
||||||
disabled={pending}
|
disabled={pending}
|
||||||
required
|
required
|
||||||
|
|||||||
Reference in New Issue
Block a user