From 30f7e297731ee5f1c555ad00609e8589f518292d Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Sun, 2 Jan 2022 16:15:52 +0100 Subject: [PATCH] Move fullname containsOptions to Identity constants --- src/services/autofill.service.ts | 2 +- src/services/autofillConstants.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/autofill.service.ts b/src/services/autofill.service.ts index 6962322eba..5ae0cf95c1 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -596,7 +596,7 @@ export default class AutofillService implements AutofillServiceInterface { // ref https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill // ref https://developers.google.com/web/fundamentals/design-and-ux/input/forms/ if (!fillFields.name && this.isFieldMatch(f[attr], - IdentityAutoFillConstants.FullNameFieldNames, ['full-name', 'your-name'])) { + IdentityAutoFillConstants.FullNameFieldNames, IdentityAutoFillConstants.FullNameFieldNameValues)) { fillFields.name = f; break; } else if (!fillFields.firstName && this.isFieldMatch(f[attr], diff --git a/src/services/autofillConstants.ts b/src/services/autofillConstants.ts index 2627affaad..b24c2c46f8 100644 --- a/src/services/autofillConstants.ts +++ b/src/services/autofillConstants.ts @@ -275,6 +275,8 @@ export class IdentityAutoFillConstants { static readonly FullNameFieldNames: string[] = ["name", "full-name", "your-name"]; + static readonly FullNameFieldNameValues: string[] = ["full-name", "your-name"]; + static readonly TitleFieldNames: string[] = ["honorific-prefix", "prefix", "title"]; static readonly FirstnameFieldNames: string[] = [