New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing props to Field validate gives previous props values #4227

Closed
spondbob opened this Issue Oct 2, 2018 · 1 comment

Comments

1 participant
@spondbob

spondbob commented Oct 2, 2018

Are you submitting a bug report or a feature request?

potential bug

What is the current behavior?

Passing props to Field validate gives previous props values, especially in this case the Quantity. Using provided sandbox, follow these steps:

  1. Open sandbox then console
  2. Set Value to 2
  3. Select Quantity to 2
  4. From console, quantity is still set to 1
  5. Press Submit
  6. Pop up has correct values {"amount":4,"quantity":"2","value":"2"}
  7. Change Value to 1 (Now in Console Quantity is 2)
  8. Error message appears

Amount should be >= Value * Quantity

What is the expected behavior?

  • Step 4 & 7 should have correct Quantity. props has previous value, not updated
  • Step 8 should not have error because 1 * 2 = 2
  • Field validation should have current props values

Sandbox Link

https://codepen.io/anon/pen/aRvmXq

What's your environment?

Redux Form@7.4.2

Other information

@spondbob

This comment has been minimized.

Show comment
Hide comment
@spondbob

spondbob Oct 2, 2018

Closing this as per discussion here where it doesn't look like a bug.

spondbob commented Oct 2, 2018

Closing this as per discussion here where it doesn't look like a bug.

@spondbob spondbob closed this Oct 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment