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: Calendar select can't switch #15338
Conversation
Deploy preview for ant-design ready! Built with commit d53e003 |
We should add some test cases.. |
Deploy preview for ant-design ready! Built with commit 5c1c4e7 |
Codecov Report
@@ Coverage Diff @@
## master #15338 +/- ##
==========================================
+ Coverage 94.11% 94.18% +0.07%
==========================================
Files 250 250
Lines 6643 6642 -1
Branches 1907 1906 -1
==========================================
+ Hits 6252 6256 +4
+ Misses 390 385 -5
Partials 1 1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #15338 +/- ##
==========================================
+ Coverage 94.11% 94.27% +0.16%
==========================================
Files 250 250
Lines 6643 6640 -3
Branches 1907 1938 +31
==========================================
+ Hits 6252 6260 +8
+ Misses 390 379 -11
Partials 1 1
Continue to review full report at Codecov.
|
所以,问题是出在哪里了? |
实际上去掉这个 defaultProps 就完了,其它改动是因为 type 老是变来变去,实在头疼就改了 测试用例在补,不要慌 |
话说这个组件用的人真少,居然都没人报 bug。 |
何不弄个问卷,或者直接在文档网页上弄个点击统计 不但方便路人看热闹,自己还能看到哪些组件该重点维护 这组件出问题我还是在写测试用例的时候发现的 |
3.1.4.x 是好的:https://codesandbox.io/s/m9ol1o05nj 感觉迁移 lifecycle j经常遇到这类问题,合之前需要多点点 😄 ref: 4601144 |
- const mode = type === 'date' ? 'month' : 'year';
- if (this.state.mode !== mode) {
- this.setState({ mode });
- this.onPanelChange(this.state.value, mode);
- }
+ setType = (mode: CalendarMode) => {
+ this.setState({ mode });
+ this.onPanelChange(this.state.value, mode);
+ } 感觉 type 也没什么用了,全部统一掉吧:
|
First of all, thank you for your contribution! 😄
New feature please send pull request to feature branch, and rest to master branch.
Pull request will be merged after one of collaborators approve.
Please makes sure that these form are filled before submitting your pull request, thank you!
[中文版模板 / Chinese template]
🤔 This is a ...
👻 What's the background?
Describe the source of requirement, like related issue link.
To close Calendar select cannot switch #15334
Describe the problem and the scenario.
💡 Solution
How to fix the problem, and list final API implementation and usage sample if that is an new feature.
GIF or snapshot should be provided if includes UI/interactive modification.
📝 Changelog description
☑️ Self Check before Merge