From f382568d1da5981e724fca59fca2f534f2456bb8 Mon Sep 17 00:00:00 2001
From: Linus Rath <139418639+rathlinus@users.noreply.github.com>
Date: Sun, 11 Oct 2026 20:49:37 +0200
Subject: [PATCH] fix: stop Bitwarden offering logins in the mail search box
---
components/search/__tests__/search-box.test.tsx | 8 ++++++++
components/search/search-box.tsx | 7 +++++--
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/components/search/__tests__/search-box.test.tsx b/components/search/__tests__/search-box.test.tsx
index 6d03c0171..e547c03dd 100644
--- a/components/search/__tests__/search-box.test.tsx
+++ b/components/search/__tests__/search-box.test.tsx
@@ -194,3 +194,11 @@ describe('SearchBox suggestions (#845)', () => {
expect(screen.queryByRole('listbox')).toBeNull();
});
});
+
+describe('SearchBox and password managers', () => {
+ 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(input()).toHaveAttribute('type', 'search');
+ });
+});
diff --git a/components/search/search-box.tsx b/components/search/search-box.tsx
index 5988d4a58..f3d36f7d4 100644
--- a/components/search/search-box.tsx
+++ b/components/search/search-box.tsx
@@ -118,8 +118,11 @@ export function SearchBox({ value, onChange, onSubmit, onClear, onSelectContact,
className="relative"
>
+ {/* type="search": Bitwarden skips search fields unconditionally (it
+ honours data-bwignore only when the user opted in) and otherwise
+ offered logins here. */}