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: Offset logic with decimal #676

Merged
merged 3 commits into from
Oct 16, 2023
Merged

fix: Offset logic with decimal #676

merged 3 commits into from
Oct 16, 2023

Conversation

@vercel
Copy link

vercel bot commented Oct 16, 2023

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

Name Status Preview Updated (UTC)
tabs ✅ Ready (Inspect) Visit Preview Oct 16, 2023 10:16am

@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #676 (222711c) into master (ad50b0a) will decrease coverage by 0.09%.
The diff coverage is 95.83%.

❗ Current head 222711c differs from pull request most recent head fc31b64. Consider uploading reports for the commit fc31b64 to get more accurate results

@@            Coverage Diff             @@
##           master     #676      +/-   ##
==========================================
- Coverage   97.72%   97.64%   -0.09%     
==========================================
  Files          18       18              
  Lines         660      678      +18     
  Branches      171      180       +9     
==========================================
+ Hits          645      662      +17     
- Misses         15       16       +1     
Files Coverage Δ
tests/common/util.tsx 90.47% <100.00%> (+1.00%) ⬆️
src/TabNavList/index.tsx 95.18% <93.75%> (-0.25%) ⬇️

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

@zombieJ zombieJ merged commit da3d43c into master Oct 16, 2023
7 checks passed
@zombieJ zombieJ deleted the fix-blink branch October 16, 2023 12:27
@FeNoMeNa
Copy link
Contributor

FeNoMeNa commented Jan 2, 2024

There is a little problem related with getBoundingClientRect, which is fixed here.

@tonny008
Copy link

tonny008 commented Jul 12, 2024

如果tab内部没有scale,使用 getBoundingClientRect本身就是个错
https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model/Determining_the_dimensions_of_elements

出现这个的原因是这里

if (offset[position] + offset[charUnit] > transformSize + visibleTabContentValue) {

floating numer的运算,导致本来想等的变大于了, 毕竟js

0.1+0.2>0.3  =>true

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