Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | - |
Expand Down
2 changes: 1 addition & 1 deletion src/SelectInput/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => {
'--select-input-width': widthCssVar,
} as React.CSSProperties,
autoFocus,
autoComplete: autoComplete ?? contextAutoComplete ?? 'new-password',
autoComplete: autoComplete ?? contextAutoComplete ?? 'off',
className: inputCls,
disabled,
value: value || '',
Expand Down
4 changes: 2 additions & 2 deletions tests/Select.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<Select showSearch open>
<Option value="1">1</Option>
Expand All @@ -1439,7 +1439,7 @@ describe('Select.Basic', () => {
);
const input = container.querySelector('input');
expect(input.getAttribute('type')).toBe('text');
expect(input.getAttribute('autocomplete')).toBe('new-password');
expect(input.getAttribute('autocomplete')).toBe('off');
});

it('forwards autocomplete to the search input', () => {
Expand Down
6 changes: 3 additions & 3 deletions tests/__snapshots__/Combobox.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Select.Combobox renders controlled correctly 1`] = `
<div
Expand All @@ -16,7 +16,7 @@ exports[`Select.Combobox renders controlled correctly 1`] = `
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="listbox"
autocomplete="new-password"
autocomplete="off"
class="rc-select-input"
id="test-id"
role="combobox"
Expand All @@ -43,7 +43,7 @@ exports[`Select.Combobox renders correctly 1`] = `
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="listbox"
autocomplete="new-password"
autocomplete="off"
class="rc-select-input"
id="test-id"
role="combobox"
Expand Down
12 changes: 6 additions & 6 deletions tests/__snapshots__/Select.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Select.Basic does not filter when filterOption value is false 1`] = `
<div
Expand Down Expand Up @@ -127,7 +127,7 @@ exports[`Select.Basic render renders aria-attributes correctly 1`] = `
aria-haspopup="listbox"
aria-label="some-label"
aria-labelledby="test-id"
autocomplete="new-password"
autocomplete="off"
class="antd-input"
id="test-id"
role="combobox"
Expand Down Expand Up @@ -158,7 +158,7 @@ exports[`Select.Basic render renders correctly 1`] = `
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="listbox"
autocomplete="new-password"
autocomplete="off"
class="antd-input"
id="test-id"
role="combobox"
Expand Down Expand Up @@ -191,7 +191,7 @@ exports[`Select.Basic render renders data-attributes correctly 1`] = `
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="listbox"
autocomplete="new-password"
autocomplete="off"
class="antd-input"
id="test-id"
role="combobox"
Expand Down Expand Up @@ -222,7 +222,7 @@ exports[`Select.Basic render renders disabled select correctly 1`] = `
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="listbox"
autocomplete="new-password"
autocomplete="off"
class="antd-input"
disabled=""
id="test-id"
Expand All @@ -249,7 +249,7 @@ exports[`Select.Basic render renders role prop correctly 1`] = `
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="listbox"
autocomplete="new-password"
autocomplete="off"
class="antd-input"
id="test-id"
role="button"
Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/Tags.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Select.Tags OptGroup renders correctly 1`] = `
<div>
Expand Down Expand Up @@ -65,7 +65,7 @@ exports[`Select.Tags OptGroup renders correctly 1`] = `
aria-expanded="true"
aria-haspopup="listbox"
aria-owns="test-id_list"
autocomplete="new-password"
autocomplete="off"
class="rc-select-input"
id="test-id"
role="combobox"
Expand Down
4 changes: 2 additions & 2 deletions tests/__snapshots__/ssr.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Select.SSR should work 1`] = `"<div class="rc-select rc-select-single"><div class="rc-select-content"><div class="rc-select-placeholder"></div><input id="test-id" type="text" readOnly="" autoComplete="new-password" class="rc-select-input" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-autocomplete="list" value=""/></div></div>"`;
exports[`Select.SSR should work 1`] = `"<div class="rc-select rc-select-single"><div class="rc-select-content"><div class="rc-select-placeholder"></div><input id="test-id" type="text" readOnly="" autoComplete="off" class="rc-select-input" role="combobox" aria-expanded="false" aria-haspopup="listbox" aria-autocomplete="list" value=""/></div></div>"`;
Loading