1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 23:33:31 +00:00

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

Submodule jslib updated: 9bc7459eac...76ece834d1

View File

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