Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with Formsy #133

Closed
janmyler opened this issue Apr 20, 2015 · 5 comments
Closed

Using with Formsy #133

janmyler opened this issue Apr 20, 2015 · 5 comments
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@janmyler
Copy link

Hi, I am using Formsy to implement forms with validations. I have a set of form components – they all implement custom behavior I need, but use some other implementations under the hood (Material-UI components, React Select, etc.).

I have an owner component implementing connection with Formsy form component, however, anytime this owner component re-renders (when its state is changed), the selected value does not get rendered in Select and I am not exactly sure why.

When I disable updates of the owner component, the Select component seems to work just fine, but then I cannot really show validation errors and other things in my wrapper component.

Any ideas what might be the cause of it?

@yale
Copy link

yale commented May 4, 2015

👍 , I am having this same issue with formsy.

@dcousens dcousens added issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet question labels May 7, 2015
@keeth
Copy link

keeth commented May 21, 2015

I was able to make Select work with Formsy without too much trouble, here's what I did, in case it helps...

https://gist.github.com/keeth/1870a553055b008cee99

It expects options like

var options = [
  { value: 'one', label: 'One' },
  { value: 'two', label: 'Two' }
];

I have not dug into the validation side of it, but the state updates seem to work.. what does your onChange handler look like? Getting that right seems like the most important thing to me.

@yale
Copy link

yale commented May 24, 2015

Thank you @keeth, I will try this out soon!

@janmyler
Copy link
Author

Thanks a lot @keeth! I gave it a quick try and it seems to work for me also. If I remember right, the mistake I did was using value instead of selectedOptions in the onChange handler.

@dcousens
Copy link
Collaborator

Thanks @keeth, going to close this. Let me know if it needs to stay open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

4 participants