react-component / util

Common Utils For React Component
util.vercel.app
MIT License
622 stars 176 forks source link

fix: scrollbar measure should consider `scrollbar-color` `::webkit-scrollbar` mixing #507

Closed zombieJ closed 5 months ago

zombieJ commented 5 months ago

css 设置 scrollbar-color 后会导致 ::webkit-scrollbar 伪类失效。测量仍然使用 ::webkit-scrollbar 的数值导致滚动条宽度的计算错误。修复成实际测量值。

vercel[bot] commented 5 months ago

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

Name Status Preview Updated (UTC)
util ✅ Ready (Inspect) Visit Preview Mar 6, 2024 6:37am
codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 69.04762% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 90.48%. Comparing base (871c2c1) to head (307c616).

Files Patch % Lines
src/getScrollBarSize.tsx 69.04% 13 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #507 +/- ## ========================================== - Coverage 91.58% 90.48% -1.11% ========================================== Files 38 38 Lines 927 935 +8 Branches 287 295 +8 ========================================== - Hits 849 846 -3 - Misses 76 87 +11 Partials 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

crazyair commented 5 months ago

69.04

zombieJ commented 5 months ago

69.04

测试盖不住,jsdom 没有真实的 DOM 环境。测试里写的也是假的。