Values in "submit" callback aren't actual
See original GitHub issueAre you submitting a bug report or a feature request?
bug report
What is the current behavior?
When I change form values using dispatch(change(..))
and submit the form via dispatch(submit(..))
, values in onSubmit
callback are old, but the state already contains new values:
https://jsfiddle.net/75rh036o/17/
What is the expected behavior?
Values should be actual
What’s your environment?
Chrome (latest)
Other information
Open “console” in jsfiddle.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Ajax callback values not saved on submit - Drupal Answers
Either $form['product_id'] and $form_state['values']['product_id'] are changed by the callback, but when I submit the form, it takes the product ...
Read more >How to do a Jquery Callback after form submit? - Stack Overflow
I just did this - $("#myform").bind('ajax:complete', function() { // tasks to do });. And things worked perfectly .
Read more >Ajax Callback retun new form element value is not available in ...
I have added a field through ajax callback [returning a render array of the new form element] , But the values are not...
Read more >Solved: Prevent submit form when using callback function i...
Solved: I have a catalog client script to validate if the input from the form already exist in the cmdb, before submitting.
Read more >Provide a set of callbacks to onSubmit method #69 - GitHub
Another way to do it is to wrap actual action in promise and send resolve/reject with it. submit(values) { return new Promise( ...
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 FreeTop 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
Top GitHub Comments
u can put dispatch(submit(…)) in setTimeout
setTimeout(dispatch(submit(..)))
I am also facing this issue. Is someone working on this, or do we have fix for this in any further versions? I tried with 7.4.2, but it seems issue is still there.