onBlur functionality in latest version of redux-form not working
See original GitHub issueAfter updating to the latest version of redux-form (v 6.4.1), the onBlur is not working as expected. For example:
I have the following two Dropdown components where the 2nd dropdown is values are dynamically allocated based on the first dropdown values.
constructor(props) {
super(props);
this.setDropdownValue = this.setDropdownValue.bind(this);
}
setDropdownValue(option) {
const routingOptions = this.props[entitiesRoutingMap[option]] || [
{
id: null,
name: 'None',
disabled: true,
},
];
this.setState({ identityType: option, routingOptions });
}
<Field component={Dropdown} valueKey="value" popup options={entities} className="row-popup" name="identityType" labelKey="label" label="Routing Type" description="Select the routing type you need" onBlur={this.setDropdownValue} />
<Field component={Dropdown} labelKey="name" valueKey="id" name="identity" popup searchable options={this.state.routingOptions} label="Routing Entry" className="row-popup" description="Some description" />
This code works perfectly fine for me with redux-form v6.3.2 . But in the latest version of the redux-form for some reason, this fails.
And when I install the latest version of redux-form, it asks to downgrade the react version and the redux version as well.
Not sure if anyone else is facing the same issue or not.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:19 (4 by maintainers)
Top Results From Across the Web
Can't update form inside of onBlur in redux-form - Stack Overflow
i have logged and i am getting inside of the else {...} clause. this.props.dispatch is being fired, but the change is not happening....
Read more >Field - Redux Form
onBlur (eventOrValue) : Function #. A function to call when the form field loses focus. It expects to either receive the React SyntheticEvent...
Read more >redux-form-normalize-on-blur - npm
a Field component that supports a normalizeOnBlur property. Latest version: 1.0.7, last published: 3 years ago.
Read more >Control component · React Redux Form
For making custom controls that work with React Redux Form, see the custom ... (Object | Function): A custom mapping from props provided...
Read more >react hook form onblur not working - You.com | The AI Search ...
I've used the example in a codesandbox and it threw errors about ref and it suggested using React.forwardRef , change your custom Input...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix released as
v6.5.0
.@erikras Would it be possible to add that unintentional functionality back please or would you accept PR? It was all nice and clean before but now we need workarounds like @semy showed us and it just doesn’t feel right IMHO.