You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you select a value from the a-select, that value renders correctly.
What is actually happening?
Selecting the a-select does not render the value.
Inspecting the a-select with vue-devtools shows that value == undefined.
Interestingly, if you submit the form, the value from a-select does appear in values after calling form.validateFields.
Old API
This behaviour worked correctly with the old fieldDecoratorId and fieldDecoratorOptions API. That's also shown in the reproduction.
Background
We use this technique of nesting a-form-items in child components to support a UI where there are different parameters required depending on the initial type someone selects. e.g.,
Select Role (options = [Employee, Manager])
If the user picks "Employee", we want things like name, date of birth, etc.
If they select "Manager", we want a very different set of parameters.
We model this as a component for each set of custom arguments.
The text was updated successfully, but these errors were encountered:
kenrose
changed the title
Component value not set when a-form-item in child component
Input / select value not set when a-form-item in child component
Jan 26, 2019
Version
1.3.3
Environment
Mac OS X 10.13, Firefox / Chome
Reproduction link
Steps to reproduce
a-form-item
s.That is, the component structure looks like:
ChildComponent
looks like:There's a full reproduction with CodeSandbox.
What is expected?
If you select a value from the
a-select
, that value renders correctly.What is actually happening?
Selecting the
a-select
does not render the value.Inspecting the
a-select
withvue-devtools
shows thatvalue == undefined
.Interestingly, if you submit the form, the value from
a-select
does appear invalues
after callingform.validateFields
.Old API
This behaviour worked correctly with the old
fieldDecoratorId
andfieldDecoratorOptions
API. That's also shown in the reproduction.Background
We use this technique of nesting
a-form-item
s in child components to support a UI where there are different parameters required depending on the initial type someone selects. e.g.,If the user picks "Employee", we want things like name, date of birth, etc.
If they select "Manager", we want a very different set of parameters.
We model this as a component for each set of custom arguments.
The text was updated successfully, but these errors were encountered: