From 4b3ab983cdff5b3313179fc394f15db89c79b91f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 16 Jul 2018 11:00:49 -0400 Subject: [PATCH] autofill fixes for cards --- jslib | 2 +- src/services/autofill.service.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/jslib b/jslib index 9bc7459eacb..76ece834d1d 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 9bc7459eacb55a234da8dd8aa71c059a4cd3e1ee +Subproject commit 76ece834d1d18e9cca71bb3c182d2284dae80958 diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index fac2136731e..63aa65b7e8c 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -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];