AlaskaAirlines / auro-input

Custom HTML element for inputting string data in forms
https://auro.alaskaair.com/components/auro/input
Apache License 2.0
2 stars 4 forks source link

Google Autofill Credit Card Not Being Validated Properly #271

Open danhiel opened 11 months ago

danhiel commented 11 months ago

Please verify the version of auro-input you have installed

2.15.0

Please describe the bug

  1. Go to any auro-input payment forms with Credit Card in it. In this case, I used https://mow-qa.alaskaair.com/preorderfood
  2. Click on the auro-input
  3. Use the autofill payment as suggested by Google
  4. Voila -- The credit card auro input is not formatted and is being told the number is invalid

Reproducing the error on the docsite

This issue cannot be reproduced on the Auro docsite

Expected behavior

Once autofilled, the credit card number should format and it should be valid.

What browsers are you seeing the problem on?

Chrome Also tested on Safari, iPhone, Android

Additional context

GIF: autofill-payment-bug

Code:

<auro-input
        key="edit"
        name="cardNumber"
        validateOnInput
        bordered
        required
        icon
        type="credit-card"
        value={props.state.cardNumber}
        onInput={(e: ChangeEvent<HTMLInputElement>) => props.onChange({ cardNumber: e.target.value })}
      >
        <slot slot="label">Card number</slot>
        <slot slot="helptext">Valid credit card numbers must include 16 digits (15 for Amex).</slot>
</auro-input>

Story under Inflight team: AB#948160

danhiel commented 10 months ago

Upon further investigation with @jason-capsule42,

We discovered that there are actually two bugs.

Let me know if you want me to break this up into two different issues or if we can just track under this issue.

blackfalcon commented 10 months ago

@danhiel I believe that @jason-capsule42 is digging into this one but I believe that it makes sense as it stands to keep this as the one issue to move forward on. Keep eyes on this issue, as things change we will make updates here.

blackfalcon commented 10 months ago

I added @Patrick-Daly-AA back to this issue to keep him aware of any changes to this issue until it has been officially prepared for work within a sprint.

Patrick-Daly-AA commented 10 months ago

Best guess on a root cause from the team is that Autofill does not trigger a change event which would run validation and cleavejs. Will need to investigate options to address this.