From 9e350e25ce988d523b5e39fb3dce8f9a3ed5c085 Mon Sep 17 00:00:00 2001 From: Daniel James Smith Date: Sun, 2 Jan 2022 15:41:52 +0100 Subject: [PATCH] Move fullname fieldnames 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 a03562f75a..be65fbdcd2 100644 --- a/src/services/autofill.service.ts +++ b/src/services/autofill.service.ts @@ -602,7 +602,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], - ['name', 'full-name', 'your-name'], ['full-name', 'your-name'])) { + IdentityAutoFillConstants.FullNameFieldNames, ['full-name', 'your-name'])) { 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 c586dfeafe..0ef5295be9 100644 --- a/src/services/autofillConstants.ts +++ b/src/services/autofillConstants.ts @@ -190,6 +190,8 @@ export class IdentityAutoFillConstants { "data-recurly", ]; + static readonly FullNameFieldNames: string[] = ["name", "full-name", "your-name"]; + static readonly TitleFieldNames: string[] = ["honorific-prefix", "prefix", "title"]; static readonly FirstnameFieldNames: string[] = [