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 }}
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
Control components' handleLoad() making the field invalid as there is no defaultValue (undefined). This happens when I have fired an onChange(value) already from my custom components' componentdidMount. But since Control's componentDidMount runs after the custom component, it dispatches a setErrors()as there is no defaultValue
Steps to Reproduce
I have a custom dropdown which turns into a label if there is only one option to show. So in the componentDidMount of my custom component, I have this code
if (options && options.length === 1) { this.props.onChange(options[0].value); }
This seems to work OK, but the field stays invalid in the store, as this is a required field.
Expected Behavior
After dispatching onChange, the field should become valid.
Actual Behavior
The field stays invalid in the store.
The text was updated successfully, but these errors were encountered:
On 12 Sep 2018, at 17:36, David Khourshid ***@***.***> wrote:
Do you have a fix? I welcome any PRs.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The Problem
Control components' handleLoad() making the field invalid as there is no defaultValue (undefined). This happens when I have fired an onChange(value) already from my custom components' componentdidMount. But since Control's componentDidMount runs after the custom component, it dispatches a setErrors()as there is no defaultValue
Steps to Reproduce
I have a custom dropdown which turns into a label if there is only one option to show. So in the componentDidMount of my custom component, I have this code
if (options && options.length === 1) { this.props.onChange(options[0].value); }
This seems to work OK, but the field stays invalid in the store, as this is a required field.
Expected Behavior
After dispatching onChange, the field should become valid.
Actual Behavior
The field stays invalid in the store.
The text was updated successfully, but these errors were encountered: