react-redux-form icon indicating copy to clipboard operation
react-redux-form copied to clipboard

Reset action is not restoring the visual state of select controls

Open jjmr opened this issue 7 years ago • 0 comments

The Problem

When a reset action is launched, the model is restored to its initial state, however, the visual status of a Control.select is not restored to the defaultValue nor the first selectable option.

Steps to Reproduce

  • Open a form with a select (the simple form example of the documentation for instance)
  • Change its value to an option
  • Click on the reset button
  • Check that the selected option is still visible

Expected Behavior

The normal behavior of a form is to set the first option of the select. In the case of RFF I think it should be the defaultValue or the first option

Actual Behavior

The last selected value is still visible after resetting the form

Reproducible Code Example

Simple form (https://codepen.io/davidkpiano/pen/e384d9c541679c8141979c590ac24d80)

jjmr avatar Jan 30 '18 16:01 jjmr