Open ddluc opened 4 years ago
If it helps anyone out, a workaround would be to replace meta.isTouched
with the following:
(meta.touchedInputs.cardNumber && meta.erroredInputs.cardNumber) ||
(meta.touchedInputs.expiryDate && meta.erroredInputs.expiryDate) ||
(meta.touchedInputs.cvc && meta.erroredInputs.cvc)
Expected Behavior:
If no zip input is provided, it should be omitted from
meta.touched
andmeta.isTouched
.Actual Behavior:
I setup
react-payment-inputs
as follows:For the life of me, I couldn't understand why the error was not rendering. However, upon further inspection I found the following:
Since I'm not providing a zip field, it's never touched and
meta.touched
is alwaysfalse
, making it impossible to render the error message. It seems likely that I could be doing something wrong, but I couldn't find a solution to this in the docs or by searching through closed issues.