braintree / braintree-web

A suite of tools for integrating Braintree in the browser
https://developer.paypal.com/braintree/docs/start/hello-client/javascript/v3
MIT License
444 stars 134 forks source link

Hosted fields triggers cardTypeChange multiple times when when it's autofilled by browser #695

Closed ruslantimofeev closed 1 year ago

ruslantimofeev commented 1 year ago

General information

Issue description

When autofilling the form with saved card in Chrome the SDK triggers cardTypeChange event 4 times that does not seem correct as the type changes only once.

on-card-type-chage

Example https://codepen.io/rustavely/pen/LYMxavd

jplukarski commented 1 year ago

@ruslantimofeev thanks for bringing this to our attention. We'll add a ticket to our backlog to look into fixing this bug.

For internal tracking purposed -> 22016

jplukarski commented 1 year ago

@ruslantimofeev After some investigation, this is occurring because of the way Chrome mimics user input in its autofill feature (this issue does not happen on Firefox). Moreover, there is no way to detect if chrome autofill has been used to fill in data via javascript. We're going to close this issue since we cannot control how Chrome fills in the data via autofill.

Let us know if you have any other questions.