question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onBlur functionality in latest version of redux-form not working

See original GitHub issue

After 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:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:19 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
erikrascommented, Jan 26, 2017

Fix released as v6.5.0.

4reactions
kolpavcommented, Dec 30, 2016

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found