final-form / final-form/react-final-form

Components do not rerender if mutator takes too long to complete. Additionally it should rerender without me having to click elsewhere on form

Open
#410 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

**bug report**

### What is the current behavior?
If you update a component using a mutator, and the `util.changeValues` only occurs after several milliseconds, the component does not rerender with the new value. It will rerender if you click on another form component.

https://codesandbox.io/s/w2rz0q1595

Click the "company" input. Then click anywhere on the page. The company input should contain the text "Hello".

Reduce the setTimeout in the setCompany mutator from 1000 to 10. Now when you click inside and outside the input it rerenders the control

### What is the expected behavior?
Update components even if mutators take a while e.g. due to waiting for long-running promise
Update components without having to click elsewhere on screen

### Sandbox Link

https://codesandbox.io/s/w2rz0q1595

### What's your environment?

React Final Form version: 4.0.2
Final Form version: 4.11.0
OS: Windows 10
Browser: Chrome 71

### Other information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.