Skip to content

Commit

Permalink
feat(Cascader): support autoClearSearchValue (ant-design#44033)
Browse files Browse the repository at this point in the history
* feat(Cascader): support autoClearSearchValue

* type: add type
  • Loading branch information
linxianxi authored Aug 9, 2023
1 parent cfdc446 commit a67f943
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/cascader/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Cascade selection box.
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| allowClear | Show clear button | boolean \| { clearIcon?: ReactNode } | false | 5.8.0: Support object type |
| autoClearSearchValue | Whether the current search will be cleared on selecting an item. Only applies when `multiple` is `true` | boolean | true | 5.9.0 |
| autoFocus | If get focus when component mounted | boolean | false | |
| bordered | Whether has border style | boolean | true | |
| changeOnSelect | (Work on single select) Change value on each selection if set to true, see above demo for details | boolean | false | |
Expand Down
1 change: 1 addition & 0 deletions components/cascader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export type CascaderProps<DataNodeType extends BaseOptionType = any> =
suffixIcon?: React.ReactNode;
options?: DataNodeType[];
status?: InputStatus;
autoClearSearchValue?: boolean;

rootClassName?: string;
popupClassName?: string;
Expand Down
1 change: 1 addition & 0 deletions components/cascader/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ demo:
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| allowClear | 支持清除 | boolean \| { clearIcon?: ReactNode } | false | 5.8.0: 支持对象形式 |
| autoClearSearchValue | 是否在选中项后清空搜索框,只在 `multiple``true` 时有效 | boolean | true | 5.9.0 |
| autoFocus | 自动获取焦点 | boolean | false | |
| bordered | 是否有边框 | boolean | true | |
| changeOnSelect | (单选时生效)当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false | |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"copy-to-clipboard": "^3.2.0",
"dayjs": "^1.11.1",
"qrcode.react": "^3.1.0",
"rc-cascader": "~3.14.0",
"rc-cascader": "~3.15.0",
"rc-checkbox": "~3.1.0",
"rc-collapse": "~3.7.0",
"rc-dialog": "~9.2.0",
Expand Down

0 comments on commit a67f943

Please sign in to comment.