-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
feat: add groupLabel FieldName #941
Conversation
BoyYangzai
commented
May 16, 2023
- fix [select] 开启OptGroup ,并自定义fieldNames时,分组label不显示 ant-design/ant-design#42328
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #941 +/- ##
=======================================
Coverage 99.63% 99.63%
=======================================
Files 37 37
Lines 1352 1353 +1
Branches 381 366 -15
=======================================
+ Hits 1347 1348 +1
Misses 4 4
Partials 1 1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
src/utils/valueUtil.ts
Outdated
let label; | ||
if (isGroupOption) { | ||
label = data[groupLabel] | ||
} else { | ||
label = data[fieldLabel] | ||
} |
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.
let label; | |
if (isGroupOption) { | |
label = data[groupLabel] | |
} else { | |
label = data[fieldLabel] | |
} | |
const label = isGroupOption ? data[groupLabel] : data[fieldLabel]; |
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.
糟糕的code水平被发现了😭
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.
let label; | |
if (isGroupOption) { | |
label = data[groupLabel] | |
} else { | |
label = data[fieldLabel] | |
} | |
const label = data[isGroupOption ? groupLabel : fieldLabel]; |