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

Entering every 4th digit doesn't trigger onChange #21

Closed
mmcnellis opened this issue Oct 27, 2016 · 7 comments
Closed

Entering every 4th digit doesn't trigger onChange #21

mmcnellis opened this issue Oct 27, 2016 · 7 comments

Comments

@mmcnellis
Copy link

mmcnellis commented Oct 27, 2016

Due to
Payment.formatCardNumber ReactDOM.findDOMNode(@refs[@inputsRefs[inputsNames["number"]]])
the DOM is directly manipulated on every 4th digit entry, and thus card data cannot be saved to state using onChange events.

@ferenckv
Copy link

ferenckv commented Nov 2, 2016

I'm having this very same issue but only when using redux-forms.

@Stas-Buzunko
Copy link

Hi, the same issue, have you found a way to fix it?

@ferenckv
Copy link

It looks like an issue with paymentjs and React: jessepollak/payment#53

@mmcnellis
Copy link
Author

@ferenckv @Stas-Buzunko I came up with a working solution the other day: mmcnellis@1c416aa

Just add a function in the parent component that updates card number in state, and pass it as the updateNumber prop. Works like a charm

@shatran
Copy link
Owner

shatran commented Jan 3, 2017

I'll wait for a development on the card.js front. Maybe they will find a solution for that.

@JesperWe
Copy link

JesperWe commented Jan 9, 2017

Thanks for the workaround to this annoying bug, @mmcnellis! (Although I prefer to pass the whole event instead of the value to use the same handler as for onChange)

@shatran
Copy link
Owner

shatran commented Jan 31, 2017

Is this issue solved with the new version?

@shatran shatran closed this as completed Jun 5, 2017
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

5 participants