You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resetting array fields does not trigger full re-render #2228
When using form.reset({ fieldName: arr }) to set the state of an array mode field to an array with fewer elements than the field's defaultValue, the elements defaultValue[arr.length] through defaultValue[defaultValue.length - 1] will still render.
Example:
defaultValue = [1, 2, 3]
form.reset({ fieldName: [4] })
rendered values: 4, 2, 3.
Notes:
This only applies if the value of fieldName has not been altered since the initial page load. If you alter the value (e.g. by adding another element) before resetting, the reset value will be properly rendered.
The actual state of the form is correctly updated by the reset. You can see in my provided code that if you click reset, then submit, the submitted value is as expected (and the form re-renders to show the correct state).
Activity