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.

[BUG]: Formsy-react is using state._value but formsy-material-ui using state.value

See original GitHub issue

I found the bug in your source code because Chrome auto-filled but Formsy-react not recieving onChange event. I think it’s a bug widely ranged in this repo that guys like me who don’t know well about this repo can’t fix it totally.

Cause:

Chrome autofill triggers change event Formsy-react is using this.state._value But formsy-material-ui uses setState({value}) when recieving onChange event

Quick fix for FormsyText:

  handleChange: function handleChange(event) {
    ...
    this.setState({
      value: event.currentTarget.value,
    });
    // change to
    this.setValue(event.currentTarget.value);
    ...
  },
  ...
  render() {
    ...
        value={this.state.value}
        // change to
        value={this.state._value}
    ...
  }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

1reaction
Stupidismcommented, Sep 6, 2016

I think there are some related issues:

0reactions
rojobuffalocommented, Dec 5, 2016

@Stupidism ok sounds good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

formsy-react/README.md at master - GitHub
A form input builder and validator for React JS. ... to use bootstrap with formsy-react, or use formsy-material-ui to use Material-UI with formsy-react....
Read more >
Formsy-material-ui do not validate initial render - Stack Overflow
I've been looking into the source code of formsy-material-ui, and it seems that the text field is setting its value right before it's ......
Read more >
formsy-react - npm
Start using formsy-react in your project by running `npm i formsy-react`. ... Use handlers for different states of your form.
Read more >
React form validation solutions: An ultimate roundup
This roundup is a comprehensive look at some of the most popular solutions for form management and validation in React.
Read more >
React Forms Tutorial: Access Input Values, Validate, Submit ...
A step by step tutorial on how to access input values, validate, and submit forms in React.
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