medipass / react-payment-inputs

A React Hook & Container to help with payment card input fields.
https://medipass.github.io/react-payment-inputs
342 stars 62 forks source link

Fix: always return invalid to credit card number if has custom error messages #18

Closed LuizMoratelli closed 4 years ago

LuizMoratelli commented 4 years ago

closes #17

Force remove blank spaces of the card number.

It would be better if we found out why when errorMessages is set the blanks of the card number are not removed.

jxom commented 4 years ago

It seems to be happening due to the errorMessages object not being memoized, which causes an update of the dependency array here. I think this PR is good to merge though - thank you!

jxom commented 4 years ago

I merged this on #19 as I had to make a small change to preserve the lockfile. Don't worry - your commits still count!