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: the month and year cannot be switched after the datepicker is rendered in Calendar #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edc-hui
Copy link

@edc-hui edc-hui commented Nov 23, 2022

修复ant design 中 Calendar 内渲染 Datepicker 后无法切换月份年份的问题。
fix ant-design/ant-design#38731

@vercel
Copy link

vercel bot commented Nov 23, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
picker ❌ Failed (Inspect) Nov 30, 2022 at 1:57AM (UTC)

@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Merging #535 (dfbe7bd) into master (66b486d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #535   +/-   ##
=======================================
  Coverage   99.32%   99.33%           
=======================================
  Files          49       49           
  Lines        2236     2246   +10     
  Branches      652      653    +1     
=======================================
+ Hits         2221     2231   +10     
  Misses         13       13           
  Partials        2        2           
Impacted Files Coverage Δ
src/PickerPanel.tsx 100.00% <100.00%> (ø)
tests/util/commonUtil.tsx 93.93% <100.00%> (+0.83%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@yoyo837
Copy link
Member

yoyo837 commented Nov 29, 2022

Vercel 的CI忽略它

@edc-hui
Copy link
Author

edc-hui commented Nov 29, 2022

Vercel 的CI忽略它

好的 明白了

@edc-hui
Copy link
Author

edc-hui commented Dec 5, 2022

@afc163 帮忙再看下这次代码可以么

@afc163 afc163 requested review from zombieJ and MadCcc December 5, 2022 12:51
@afc163
Copy link
Member

afc163 commented Dec 23, 2022

@zombieJ 看看

@@ -334,8 +336,9 @@ function PickerPanel<DateType>(props: PickerPanelProps<DateType>) {

// ============================ Effect ============================
React.useEffect(() => {
if (value && !initRef.current) {
if (value && !isEqual(generateConfig, value, originalValue.current) && !initRef.current) {
Copy link
Member

Choose a reason for hiding this comment

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

这个 value object 变化重置是 by design,做 date 判断反而是非预期的。我去那边评论一下~

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.

[email protected]中 Calendar 内渲染 datepicker 后无法切换月份年份
4 participants