From 6ea5526783ef36d3d93ffab99c2ee3b75c4455f5 Mon Sep 17 00:00:00 2001
From: Linus Rath <139418639+rathlinus@users.noreply.github.com>
Date: Sun, 11 Oct 2026 20:43:47 +0200
Subject: [PATCH] fix: stop Bitwarden offering logins in the recipient fields
---
.../__tests__/recipient-autocomplete.test.tsx | 6 ++++++
components/email/email-composer.tsx | 16 ++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/components/email/__tests__/recipient-autocomplete.test.tsx b/components/email/__tests__/recipient-autocomplete.test.tsx
index df689f62a..97c1eb937 100644
--- a/components/email/__tests__/recipient-autocomplete.test.tsx
+++ b/components/email/__tests__/recipient-autocomplete.test.tsx
@@ -208,6 +208,12 @@ const settle = () => act(() => new Promise((r) => setTimeout(r, 300)));
describe('recipient autocomplete', () => {
beforeEach(() => { vi.clearAllMocks(); });
+ it('is a search field, which Bitwarden never offers to fill', () => {
+ // data-bwignore only works when the user opted in to it in Bitwarden.
+ render();
+ expect(toInput()).toHaveAttribute('type', 'search');
+ });
+
it('does not reopen the suggestions after a typed address was committed', async () => {
render();
const input = toInput();
diff --git a/components/email/email-composer.tsx b/components/email/email-composer.tsx
index 0ed3b5824..812ec48b6 100644
--- a/components/email/email-composer.tsx
+++ b/components/email/email-composer.tsx
@@ -4416,7 +4416,9 @@ function RecipientChipInput({
{isEditing ? (
setEditValue(e.target.value)}
onKeyDown={(e) => {
@@ -4436,7 +4438,7 @@ function RecipientChipInput({
}
handleSaveEdit(editValue);
}}
- className="flex-1 min-w-[80px] border-0 outline-none h-5 text-sm bg-transparent text-foreground placeholder:text-muted-foreground"
+ className="flex-1 min-w-[80px] border-0 outline-none h-5 text-sm bg-transparent text-foreground placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none"
placeholder={editingChip?.editType === 'email' ? t('recipient_email_placeholder') : t('recipient_name_placeholder')}
data-bwignore="true"
/>
@@ -4480,16 +4482,22 @@ function RecipientChipInput({
/>
)}
{!editingChip && (
+ // type="search": Bitwarden skips search fields unconditionally, but
+ // honours data-bwignore only when the user opted in, so its inline
+ // menu offered logins for the "E-Mail" placeholder. The other
+ // data-* attributes cover 1Password, LastPass and Dashlane.
0}
aria-autocomplete="list"