Is there a way to update outer formData from within a custom widget ?
See original GitHub issuePrerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- Ideally, I’m providing a sample JSFiddle or a shared playground link demonstrating the issue.
Description
Right now, a widget can update only the field it’s associated with, using prop.onChange.
I have a case, where one of the widgets is actually a google autocomplete address. This, requires emit or modify the formData, so that other fields such as city, state, zip can also be updated in formData; and thus, to make the widgets associated with them pick the relevant formData update, and fill in the value.
Version
Latest ^1.2.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Is there a way to update outer formData from within a custom ...
Right now, a widget can update only the field it's associated with, using prop.onChange . I have a case, where one of the...
Read more >Custom ui:widget will not alter the formData - Stack Overflow
You should hand down react-jsonschema-form's (FieldProps, if you are using typescript) onChange inside DefaultInput to the actual input field.
Read more >Custom Widgets and Fields - React Jsonschema form
The API allows to specify your own custom widget and field components: A widget represents a HTML tag for the user to enter...
Read more >Create a custom form widget that displays the populated values
This article provides information on how to create a custom form widget displaying populated values.
Read more >Update Form Data Using the API - DevExtreme - DevExpress
If you need to update form data at runtime, redefine the formData object. In this case, form item values are updated automatically and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @OleksiL , here is a glimpse:
where we have also, provided our RJSF Form, a set of custom
fieldsandwidgetsthat you want to register. E.g. in this case (simplified version)Then,
schemanow, this will look likeformDatawill then contain an objectaddressFieldNamewhich will then havecityandzipstrings underneath.Hope it helps, cheers!
– kks1
Closing this issue, but feel free to repoen it if you have any additional questions!