From 4438188362f2db796ff36a4c73791c385a66ed31 Mon Sep 17 00:00:00 2001 From: Ryan Moon Date: Mon, 30 Mar 2026 07:18:58 -0500 Subject: [PATCH] Fix vault dialog autofill: prevent browser password manager from overriding dark theme colors --- packages/admin/src/app.css | 9 +++++++++ .../admin/src/routes/_authenticated/vault/index.tsx | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/admin/src/app.css b/packages/admin/src/app.css index 3d73043..dbcbca2 100644 --- a/packages/admin/src/app.css +++ b/packages/admin/src/app.css @@ -88,3 +88,12 @@ body { border-color: #2a3a52 !important; transition: background-color 5000s ease-in-out 0s; } + +/* Prevent browser autofill from overriding dark theme input colors */ +input:-webkit-autofill, +input:-webkit-autofill:hover, +input:-webkit-autofill:focus { + -webkit-box-shadow: 0 0 0 1000px hsl(var(--background)) inset !important; + -webkit-text-fill-color: hsl(var(--foreground)) !important; + transition: background-color 5000s ease-in-out 0s; +} diff --git a/packages/admin/src/routes/_authenticated/vault/index.tsx b/packages/admin/src/routes/_authenticated/vault/index.tsx index 7267638..964735c 100644 --- a/packages/admin/src/routes/_authenticated/vault/index.tsx +++ b/packages/admin/src/routes/_authenticated/vault/index.tsx @@ -364,26 +364,26 @@ function VaultMain() { { setNewEntryOpen(open); if (!open) setEditEntryId(null) }}> {editEntryId ? 'Edit Entry' : 'New Entry'} -
+
- setEntryForm((f) => ({ ...f, name: e.target.value }))} placeholder="e.g. Store WiFi" autoFocus /> + setEntryForm((f) => ({ ...f, name: e.target.value }))} placeholder="e.g. Store WiFi" autoFocus autoComplete="off" />
- setEntryForm((f) => ({ ...f, username: e.target.value }))} placeholder="Optional" /> + setEntryForm((f) => ({ ...f, username: e.target.value }))} placeholder="Optional" autoComplete="off" />
- setEntryForm((f) => ({ ...f, url: e.target.value }))} placeholder="Optional" /> + setEntryForm((f) => ({ ...f, url: e.target.value }))} placeholder="Optional" autoComplete="off" />
- setEntryForm((f) => ({ ...f, notes: e.target.value }))} placeholder="Optional" /> + setEntryForm((f) => ({ ...f, notes: e.target.value }))} placeholder="Optional" autoComplete="off" />
- setEntryForm((f) => ({ ...f, secret: e.target.value }))} placeholder="Password or secret value" /> + setEntryForm((f) => ({ ...f, secret: e.target.value }))} placeholder="Password or secret value" autoComplete="new-password" />