autofill fixes for cards

This commit is contained in:
Kyle Spearrin 2018-07-16 11:00:49 -04:00
parent 2749216a34
commit 4b3ab983cd
2 changed files with 5 additions and 3 deletions

2
jslib

@ -1 +1 @@
Subproject commit 9bc7459eacb55a234da8dd8aa71c059a4cd3e1ee
Subproject commit 76ece834d1d18e9cca71bb3c182d2284dae80958

View File

@ -20,6 +20,8 @@ import {
const CardAttributes: string[] = ['autoCompleteType', 'data-stripe', 'htmlName', 'htmlID', 'label-tag',
'placeholder', 'label-left', 'label-top'];
const CardAttributesExtended: string[] = [...CardAttributes, 'label-right'];
const IdentityAttributes: string[] = ['autoCompleteType', 'data-stripe', 'htmlName', 'htmlID', 'label-tag',
'placeholder', 'label-left', 'label-top'];
@ -550,7 +552,7 @@ export default class AutofillService implements AutofillServiceInterface {
}
let doesContain = false;
CardAttributes.forEach((attr) => {
CardAttributesExtended.forEach((attr) => {
if (doesContain || !field.hasOwnProperty(attr) || !field[attr]) {
return;
}
@ -780,7 +782,7 @@ export default class AutofillService implements AutofillServiceInterface {
for (let i = 0; i < field.selectInfo.options.length; i++) {
const option = field.selectInfo.options[i];
for (let j = 0; j < option.length; j++) {
if (option[j].toLowerCase() === dataValue.toLowerCase()) {
if (this.hasValue(option[j]) && option[j].toLowerCase() === dataValue.toLowerCase()) {
doFill = true;
if (option.length > 1) {
dataValue = option[1];