Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cascader component value support number type #24247

Merged
merged 1 commit into from
May 18, 2020

Conversation

Loogeek
Copy link
Contributor

@Loogeek Loogeek commented May 18, 2020

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Perfermance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#17407

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Cascader not support number[] value.
🇨🇳 Chinese 修复 Cascader 不支持 number[] 类型 value 的问题。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

View rendered components/cascader/index.en-US.md
View rendered components/cascader/index.zh-CN.md

@ant-design-bot
Copy link
Contributor

ant-design-bot commented May 18, 2020

@codecov
Copy link

codecov bot commented May 18, 2020

Codecov Report

Merging #24247 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24247   +/-   ##
=======================================
  Coverage   98.82%   98.82%           
=======================================
  Files         364      364           
  Lines        7291     7291           
  Branches     2020     1970   -50     
=======================================
  Hits         7205     7205           
  Misses         86       86           
Impacted Files Coverage Δ
components/cascader/index.tsx 97.20% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 04ad723...6e17a24. Read the comment docs.

@afc163
Copy link
Member

afc163 commented May 18, 2020

类似 Form 来个 type.test.tsx 做 ts 定义的测试用例吧。

@Loogeek
Copy link
Contributor Author

Loogeek commented May 18, 2020

类似 Form 来个 type.test.tsx 做 ts 定义的测试用例吧。

不是太明白项目中几个type.test.tsx测试用例的作用,加了下,看看是否可以

@afc163
Copy link
Member

afc163 commented May 18, 2020

不是太明白项目中几个type.test.tsx测试用例的作用,加了下,看看是否可以

就是测试 tsc 编译是否能过,你故意写错然后跑一下 npm test -- components/cascader 就能测试出来了。

@Loogeek
Copy link
Contributor Author

Loogeek commented May 18, 2020

就是测试 tsc 编译是否能过,你故意写错然后跑一下 npm test -- components/cascader 就能测试出来了。

是的,我有试过,比如result的type.test加了个数值的prefixCls,看test都还是过的

@afc163
Copy link
Member

afc163 commented May 18, 2020

npm run tsc 应该能检查出来。

@Loogeek
Copy link
Contributor Author

Loogeek commented May 18, 2020

npm run tsc

恩恩,tsc能检测出来

@afc163 afc163 merged commit a216d6e into ant-design:master May 18, 2020
@@ -42,7 +42,7 @@ Cascade selection box.
| size | input size | `large` \| `middle` \| `small` | | |
| style | additional style | CSSProperties | - | |
| suffixIcon | The custom suffix icon | ReactNode | - | |
| value | selected value | string\[] | - | |
| value | selected value | string\[] | number\[] | - | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- | defaultValue | initial selected value | string\[] | number\[] | \[] |  |
+ | defaultValue | initial selected value | string\[] \| number\[] | \[] |  |

@@ -25,7 +25,7 @@ Cascade selection box.
| bordered | whether has border style | boolean | true | |
| changeOnSelect | change value on each selection if set to true, see above demo for details | boolean | false | |
| className | additional css class | string | - | |
| defaultValue | initial selected value | string\[] | \[] | |
| defaultValue | initial selected value | string\[] | number\[] | \[] | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- | defaultValue | initial selected value | string\[] | number\[] | \[] |  |
+ | defaultValue | initial selected value | string\[] \| number\[] | \[] |  |

@yoyo837 yoyo837 mentioned this pull request May 18, 2020
17 tasks
@Loogeek Loogeek deleted the cascader-value-type branch May 23, 2020 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants