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

Callback for Error to Valid State #39

Open
venkatnsrinivasan opened this issue Mar 5, 2019 · 3 comments
Open

Callback for Error to Valid State #39

venkatnsrinivasan opened this issue Mar 5, 2019 · 3 comments

Comments

@venkatnsrinivasan
Copy link

Hello ,
Is there any callback i can use to indicate that the component moved from error to valid state for all its inputs ? I can use the onError to track the errors but there is no callback when it moves out of error state. I would like the error state to enable/disable my submit button for e.g.
Thanks

ianchouinard added a commit to ianchouinard/react-credit-card-input that referenced this issue Mar 8, 2019
opassion pushed a commit to opassion/react-credit-card-input that referenced this issue Mar 17, 2019
added prop method for validity change (medipass#39/40)
@png262
Copy link

png262 commented May 20, 2019

Hi, agree with the request here, currently it is very difficult for me to use this Credit Card component inside of a form logic, where I need to be able to check that all Credit Card details (card number, cvv, zipcode) are all valid before submitting/processing the form.
All of the validation logic happens internally within the component's state, and there isn't an easy way for the parent component / form logic to verify that all credit card details are good.

@jxom
Copy link
Contributor

jxom commented May 21, 2019

I am currently finishing up a new package for using payment inputs with React, which I hope to publish soon!

The new package will handle input errors a lot better than react-credit-card-input.

If you're interested, I'm planning to add a migration guide to migrate from react-credit-card-input to the new package - don't worry, it will be a small migration.

I'll comment here again once it's published. :)

@jxom
Copy link
Contributor

jxom commented May 26, 2019

We have just recently published a new library, React Payment Inputs which is a rewrite of react-credit-card-input, and fixes a lot of issues that were raised in this repository as well as a few extra enhancements.

Your issue that you raised here should be fixed in React Payment Inputs - however, if you wish to still use react-credit-card-inputs, I'll try find time to fix this issue in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants