From 0990851bf4e31e94ff9446e0263cf19dea3451fd Mon Sep 17 00:00:00 2001 From: stussysenik <35629779+stussysenik@users.noreply.github.com> Date: Tue, 24 Nov 2026 13:55:31 +0100 Subject: [PATCH] fix(select): default autocomplete off --- README.md | 2 +- src/SelectInput/Input.tsx | 2 +- tests/Select.test.tsx | 4 ++-- tests/__snapshots__/Combobox.test.tsx.snap | 6 +++--- tests/__snapshots__/Select.test.tsx.snap | 12 ++++++------ tests/__snapshots__/Tags.test.tsx.snap | 4 ++-- tests/__snapshots__/ssr.test.tsx.snap | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 0363bd2ea..40f991a78 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Select also accepts public props from `BaseSelect`, except `showSearch`, which i | Name | Description | Type | Default | | --- | --- | --- | --- | -| autoComplete | Browser autocomplete hint for the search input. | string | `new-password` | +| autoComplete | Browser autocomplete hint for the search input. | string | `off` | | autoClearSearchValue | Deprecated. Use `showSearch.autoClearSearchValue` instead. | boolean | true | | backfill | Backfill the active option into the input. Only works in `combobox` mode. | boolean | false | | children | Legacy option children. Prefer `options` for new code. | ReactNode | - | diff --git a/src/SelectInput/Input.tsx b/src/SelectInput/Input.tsx index dc7680443..0980fdead 100644 --- a/src/SelectInput/Input.tsx +++ b/src/SelectInput/Input.tsx @@ -171,7 +171,7 @@ const Input = React.forwardRef((props, ref) => { '--select-input-width': widthCssVar, } as React.CSSProperties, autoFocus, - autoComplete: autoComplete ?? contextAutoComplete ?? 'new-password', + autoComplete: autoComplete ?? contextAutoComplete ?? 'off', className: inputCls, disabled, value: value || '', diff --git a/tests/Select.test.tsx b/tests/Select.test.tsx index b404a9edc..3871517eb 100644 --- a/tests/Select.test.tsx +++ b/tests/Select.test.tsx @@ -1430,7 +1430,7 @@ describe('Select.Basic', () => { expect(container.querySelector('.rc-select-item-empty').textContent).toEqual('Not Found'); }); - it('uses text input type with autocomplete suppression by default', () => { + it('uses text input type with autocomplete off by default', () => { const { container } = render( "`; +exports[`Select.SSR should work 1`] = `"
"`;