DependentInput does not populate default values. #7
Comments
I found that setting the default value on the dependent input instead and setting the source, will correctly set these props and propagate them to the nested input. E.g.:
|
@pimschaaf Yes I checked and your solution is working but it is still a bug as it is a hack which will solve the problem when we have one field. In case of multiple fields we can not specify multiple sources or default values in dependent input. |
@anuragagarwal561994 I don't think Using multiple dependent inputs, each wrapped around only one input, should work in your case. |
@pimschaaf I agree that from the examples it is not clear for dependent inputs to be used for multiple input elements. But won't it make sense, because I usually have more than 1 field, so instead of writing separate dependent inputs for them it is much clearer for me to write a single dependent input wrapper and place multiple components. But I surely agree that it can be another way of seeing DependentInput, may be I got confused. At present, multiple input thing works inside DependentInput component but default works in your way but for a single component. |
You can wrap multiple children inside a single DependentInput. I'm trying to figure out why the defaultValue is not working |
wish this got resolved soon |
We're looking for a solution for this. Stay tuned :) |
Should be resolved once https://github.com/marmelab/admin-on-rest/pull/913 is finished |
This is resolved in the |
When you use an input field inside DependentInput and mention a defaultValue, the value is not filled:
Checkout:
https://codesandbox.io/s/v3o03kZL
Instructions:
The dependent field has a default value but it is not shown.
The text was updated successfully, but these errors were encountered: