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: solve animation jitter when input area less width than picker panel issue #665

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kiner-tang
Copy link
Contributor

@vercel
Copy link

vercel bot commented Aug 15, 2023

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

Name Status Preview Comments Updated (UTC)
picker ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2023 8:27am

tests/range.spec.tsx Outdated Show resolved Hide resolved
tests/range.spec.tsx Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Aug 15, 2023

Codecov Report

Merging #665 (c787cd7) into master (6919d7e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head c787cd7 differs from pull request most recent head 541cef7. Consider uploading reports for the commit 541cef7 to get more accurate results

@@           Coverage Diff           @@
##           master     #665   +/-   ##
=======================================
  Coverage   99.05%   99.05%           
=======================================
  Files          56       56           
  Lines        2430     2432    +2     
  Branches      734      735    +1     
=======================================
+ Hits         2407     2409    +2     
  Misses         21       21           
  Partials        2        2           
Files Changed Coverage Δ
src/RangePicker.tsx 99.28% <100.00%> (+<0.01%) ⬆️

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

@@ -1807,7 +1807,7 @@ describe('Picker.Range', () => {
} else if (this.className.includes('panel-container')) {
return 311;
} else if (this.className.includes('input')) {
return 285;
return 306;
Copy link
Member

Choose a reason for hiding this comment

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

实际上模拟的应该是 arrowLeft < panelWidth, 而 arrowLeft + arrowWidth > panelWidth。

arrowLeft = inputWidth + separatorWidth

这里条件不符合

Copy link
Member

@MadCcc MadCcc Aug 15, 2023

Choose a reason for hiding this comment

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

新加的条件是 inputWidth * 2 + separator > panelWidth * 2

换算一下是 inputWidth + separator / 2 > panelWidth,与 inputWidth + separator < panelWidth 矛盾了

所以条件可以重新考虑一下

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.

Date range picker with status broken animation when selecting the end date
2 participants