[PM-4415] Fixing an issue with field qualification of usernames on login forms

This commit is contained in:
Cesar Gonzalez 2024-10-08 09:23:34 -05:00
parent cafcc44716
commit 09121c7c55
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF
1 changed files with 5 additions and 4 deletions

View File

@ -430,8 +430,8 @@ export class InlineMenuFieldQualificationService
return false;
}
// If the form that contains the field has more than one visible field, we should assume
// that the field is part of an account creation form.
// If the form that contains a single field, we should assume that it is part
// of a multistep login form.
const fieldsWithinForm = pageDetails.fields.filter(
(pageDetailsField) => pageDetailsField.form === field.form,
);
@ -439,6 +439,8 @@ export class InlineMenuFieldQualificationService
return true;
}
// If multiple fields exist within the form, we should check if a single visible field exists.
// If so, we should assume that the field is part of a login form.
return fieldsWithinForm.filter((field) => field.viewable).length === 1;
}
@ -457,8 +459,7 @@ export class InlineMenuFieldQualificationService
return false;
}
// If no visible fields are found on the page, but we have a single password
// field we should assume that the field is part of a login form.
// If we have a single password field we should assume that the field is part of a login form.
if (passwordFieldsInPageDetails.length === 1) {
return true;
}