question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Values in "submit" callback aren't actual

See original GitHub issue

Are 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
sckohcommented, Apr 20, 2017

u can put dispatch(submit(…)) in setTimeout

setTimeout(dispatch(submit(..)))

1reaction
kulakshaycommented, Jun 10, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found