diff --git a/components/select/__tests__/index.test.js b/components/select/__tests__/index.test.js
index 165eac9d83..19e2055b60 100644
--- a/components/select/__tests__/index.test.js
+++ b/components/select/__tests__/index.test.js
@@ -4,6 +4,7 @@ import Select from '..';
import Icon from '../../icon';
import focusTest from '../../../tests/shared/focusTest';
import mountTest from '../../../tests/shared/mountTest';
+import { resetWarned } from '../../_util/warning';
const { Option } = Select;
@@ -132,4 +133,16 @@ describe('Select', () => {
expect(wrapper.render()).toMatchSnapshot();
});
});
+
+ it('warning if user use `inputValue`', () => {
+ resetWarned();
+ const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
+
+ mount();
+ expect(errorSpy).toHaveBeenLastCalledWith(
+ 'Warning: [antd: Select] `inputValue` is deprecated. Please use `searchValue` instead.',
+ );
+
+ errorSpy.mockRestore();
+ });
});
diff --git a/components/select/index.en-US.md b/components/select/index.en-US.md
index 11e799e9d1..590cff53a1 100644
--- a/components/select/index.en-US.md
+++ b/components/select/index.en-US.md
@@ -45,6 +45,7 @@ Select component to select value from options.
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value | |
| optionLabelProp | Which prop value of option will render as content of select. [Example](https://codesandbox.io/s/antd-reproduction-template-tk678) | string | `value` for `combobox`, `children` for other modes | |
| placeholder | Placeholder of select | string\|ReactNode | - | |
+| searchValue | Search input value | string | - | 3.23.2 |
| showArrow | Whether to show the drop-down arrow | boolean | true | 3.2.1 |
| showSearch | Whether show search input in single mode. | boolean | false | |
| size | Size of Select input. `default` `large` `small` | string | default | |
@@ -54,7 +55,6 @@ Select component to select value from options.
| menuItemSelectedIcon | The custom menuItemSelected icon with multiple options | ReactNode | - | 3.11.0 |
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string\[] | | |
| value | Current selected option. | string\|string\[]\
number\|number\[]\
LabeledValue\|LabeledValue[] | - | |
-| inputValue | Current search text | string | - | |
| onBlur | Called when blur | function | - | |
| onChange | Called when select an option or input value change, or value of input is changed in combobox mode | function(value, option:Option/Array<Option>) | - | |
| onDeselect | Called when a option is deselected, param is the selected option's value. Only called for multiple or tags, effective in multiple or tags mode only. | function(string\|number\|LabeledValue) | - | |
diff --git a/components/select/index.tsx b/components/select/index.tsx
index 66257c6fab..c4c5a95d59 100755
--- a/components/select/index.tsx
+++ b/components/select/index.tsx
@@ -54,6 +54,7 @@ export type SelectValue = string | string[] | number | number[] | LabeledValue |
export interface SelectProps extends AbstractSelectProps {
value?: T;
inputValue?: string;
+ searchValue?: string;
defaultValue?: T;
mode?: 'default' | 'multiple' | 'tags' | 'combobox' | string;
optionLabelProp?: string;
@@ -110,9 +111,6 @@ const SelectPropTypes = {
id: PropTypes.string,
};
-// => It is needless to export the declaration of below two inner components.
-// export { Option, OptGroup };
-
export default class Select extends React.Component, {}> {
static Option = Option as React.ClassicComponentClass;
@@ -140,6 +138,12 @@ export default class Select extends React.Component extends React.Component {
@@ -210,6 +206,8 @@ export default class Select extends React.Component extends React.Component