-
-
Notifications
You must be signed in to change notification settings - Fork 52.1k
fix: fix sortGradient function ignore incorrect percent #21564
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add tests to make sure this change works as expected?
7942c8c
to
3d4551b
Compare
Codecov Report
@@ Coverage Diff @@
## master #21564 +/- ##
==========================================
+ Coverage 97.84% 97.86% +0.01%
==========================================
Files 304 304
Lines 7018 7017 -1
Branches 1945 1945
==========================================
Hits 6867 6867
+ Misses 151 150 -1 Continue to review full report at Codecov.
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2355db1:
|
components/progress/Line.tsx
Outdated
// eslint-disable-next-line no-restricted-syntax | ||
for (const [key, value] of Object.entries(gradients)) { | ||
let tempArr: any[] = []; | ||
Object.entries(gradients).forEach(([key, value]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
换一下,Object.entries 在 IE 下没有。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
换成了Object.keys
,顺便把参数的type改成了StringGradients
, 这个type应该更准确。
3d4551b
to
2355db1
Compare
🤔 This is a ...
🔗 Related issue link
fix
sortGradient
function ignore incorrect percent💡 Background and solution
如果传入了错误的参数, 应该忽略掉而不是拿到一个空对象, 添加了新的测试用例并增加了覆盖率
📝 Changelog
strokeColor
props ignore incorrect percentstrokeColor
属性忽略错误的百分比参数☑️ Self Check before Merge