-
-
Notifications
You must be signed in to change notification settings - Fork 272
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: form onValues second params values #582
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@zombieJ 点Vercel 发布 failed details 404是啥情况? |
Codecov Report
@@ Coverage Diff @@
## master #582 +/- ##
=======================================
Coverage 99.82% 99.82%
=======================================
Files 16 16
Lines 1143 1146 +3
Branches 257 258 +1
=======================================
+ Hits 1141 1144 +3
Misses 2 2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
要加一下对应的测试用例哈~ |
@zombieJ 看看ok不 |
@zombieJ 看了,不过总有人会忘了加 {...field},所以我加了默认的,然后测试用例模拟了下他那个例子 |
src/Field.tsx
Outdated
@@ -625,7 +626,8 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F | |||
|
|||
function WrapperField<Values = any>({ name, ...restProps }: FieldProps<Values>) { | |||
const fieldContext = React.useContext(FieldContext); | |||
|
|||
const listContext = React.useContext(ListContext); | |||
const mergedIsListField = restProps.isListField || (!restProps.isList && !!listContext); |
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.
这边这个 isList
的用途是什么哈?
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.
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.
这个是告诉 Field 当做 List 处理,不过这里我感觉是不需要的。因为它其实自动注入 isListField
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.
@zombieJ 得加的吧,要不List的name收集值不就跳过去了么,
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.
如果加了,对于直接 List 嵌套 List 的情况,这个 isListField 就没了。
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.
嗯,明白了,我想想
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.
@zombieJ List里面的Field也给个默认值,根据是否嵌套在List里面,看下还有啥问题没考虑到不。
@zombieJ 改了,再看看 |
这个pr改动,在某个场景下,会引起bug @elevensky @zombieJ ,具体描述看这里:#597 |
close ant-design/ant-design#41053