mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-10-31 00:12:39 +00:00
fix: stop Bitwarden offering logins in the mail search box
This commit is contained in:
@@ -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(<Harness />);
|
||||
expect(input()).toHaveAttribute('type', 'search');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -118,8 +118,11 @@ export function SearchBox({ value, onChange, onSubmit, onClear, onSelectContact,
|
||||
className="relative"
|
||||
>
|
||||
<Search className="absolute start-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground" />
|
||||
{/* type="search": Bitwarden skips search fields unconditionally (it
|
||||
honours data-bwignore only when the user opted in) and otherwise
|
||||
offered logins here. */}
|
||||
<Input
|
||||
type="text"
|
||||
type="search"
|
||||
autoFocus={autoFocus}
|
||||
placeholder={t("search_placeholder_hint")}
|
||||
value={value}
|
||||
@@ -137,7 +140,7 @@ export function SearchBox({ value, onChange, onSubmit, onClear, onSelectContact,
|
||||
close();
|
||||
}}
|
||||
onKeyDown={handleKeyDown}
|
||||
className={cn("ps-9 h-9", value && "pe-8")}
|
||||
className={cn("ps-9 h-9 [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none", value && "pe-8")}
|
||||
role="combobox"
|
||||
aria-expanded={showDropdown}
|
||||
aria-controls={listId}
|
||||
|
||||
Reference in New Issue
Block a user