[PM-5806] Remove the Inline Auto-fill Menu From `textarea` Fields (#7655)
* [PM-5806] Remove the autofill overlay menu from textarea fields * [PM-5806] Running prettier * [PM-5806] Implementing a new AutofillConstant to more easily exclude overlay types * [PM-5806] Implementing a new AutofillConstant to more easily exclude overlay types
This commit is contained in:
parent
219bad0e42
commit
7436f9112d
|
@ -65,6 +65,11 @@ export class AutoFillConstants {
|
|||
"checkbox",
|
||||
...AutoFillConstants.ExcludedAutofillLoginTypes,
|
||||
];
|
||||
|
||||
static readonly ExcludedOverlayTypes: string[] = [
|
||||
"textarea",
|
||||
...AutoFillConstants.ExcludedAutofillTypes,
|
||||
];
|
||||
}
|
||||
|
||||
export class CreditCardAutoFillConstants {
|
||||
|
|
|
@ -195,8 +195,8 @@ describe("AutofillOverlayContentService", () => {
|
|||
expect(autofillFieldElement.addEventListener).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("ignores fields that are part of the ExcludedAutofillTypes", () => {
|
||||
AutoFillConstants.ExcludedAutofillTypes.forEach((excludedType) => {
|
||||
it("ignores fields that are part of the ExcludedOverlayTypes", () => {
|
||||
AutoFillConstants.ExcludedOverlayTypes.forEach((excludedType) => {
|
||||
autofillFieldData.type = excludedType;
|
||||
|
||||
autofillOverlayContentService.setupAutofillOverlayListenerOnField(
|
||||
|
|
|
@ -32,6 +32,7 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte
|
|||
private readonly findTabs = tabbable;
|
||||
private readonly sendExtensionMessage = sendExtensionMessage;
|
||||
private formFieldElements: Set<ElementWithOpId<FormFieldElement>> = new Set([]);
|
||||
private ignoredFieldTypes: Set<string> = new Set(AutoFillConstants.ExcludedOverlayTypes);
|
||||
private userFilledFields: Record<string, FillableFormFieldElement> = {};
|
||||
private authStatus: AuthenticationStatus;
|
||||
private focusableElements: FocusableElement[] = [];
|
||||
|
@ -715,12 +716,11 @@ class AutofillOverlayContentService implements AutofillOverlayContentServiceInte
|
|||
* @param autofillFieldData - Autofill field data captured from the form field element.
|
||||
*/
|
||||
private isIgnoredField(autofillFieldData: AutofillField): boolean {
|
||||
const ignoredFieldTypes = new Set(AutoFillConstants.ExcludedAutofillTypes);
|
||||
if (
|
||||
autofillFieldData.readonly ||
|
||||
autofillFieldData.disabled ||
|
||||
!autofillFieldData.viewable ||
|
||||
ignoredFieldTypes.has(autofillFieldData.type) ||
|
||||
this.ignoredFieldTypes.has(autofillFieldData.type) ||
|
||||
this.keywordsFoundInFieldData(autofillFieldData, ["search", "captcha"])
|
||||
) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue