mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
[PM-14054] Fixing scroll-based repositioning of inline menu when inline menu is focused (#11770)
This commit is contained in:
parent
d50e8bbf4c
commit
896d19551a
@ -21,6 +21,7 @@ import AutofillInit from "./autofill-init";
|
||||
domQueryService,
|
||||
domElementVisibilityService,
|
||||
inlineMenuFieldQualificationService,
|
||||
inlineMenuContentService,
|
||||
);
|
||||
|
||||
windowContext.bitwardenAutofillInit = new AutofillInit(
|
||||
|
@ -24,6 +24,7 @@ import AutofillInit from "./autofill-init";
|
||||
domQueryService,
|
||||
domElementVisibilityService,
|
||||
inlineMenuFieldQualificationService,
|
||||
inlineMenuContentService,
|
||||
);
|
||||
|
||||
windowContext.bitwardenAutofillInit = new AutofillInit(
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { mock } from "jest-mock-extended";
|
||||
import { mock, MockProxy } from "jest-mock-extended";
|
||||
|
||||
import { EVENTS } from "@bitwarden/common/autofill/constants";
|
||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||
@ -13,6 +13,7 @@ import {
|
||||
import AutofillField from "../models/autofill-field";
|
||||
import AutofillForm from "../models/autofill-form";
|
||||
import AutofillPageDetails from "../models/autofill-page-details";
|
||||
import { AutofillInlineMenuContentService } from "../overlay/inline-menu/abstractions/autofill-inline-menu-content.service";
|
||||
import { createAutofillFieldMock } from "../spec/autofill-mocks";
|
||||
import {
|
||||
flushPromises,
|
||||
@ -35,6 +36,7 @@ describe("AutofillOverlayContentService", () => {
|
||||
let domElementVisibilityService: DomElementVisibilityService;
|
||||
let autofillInit: AutofillInit;
|
||||
let inlineMenuFieldQualificationService: InlineMenuFieldQualificationService;
|
||||
let inlineMenuContentService: MockProxy<AutofillInlineMenuContentService>;
|
||||
let autofillOverlayContentService: AutofillOverlayContentService;
|
||||
let sendExtensionMessageSpy: jest.SpyInstance;
|
||||
const sendResponseSpy = jest.fn();
|
||||
@ -44,10 +46,12 @@ describe("AutofillOverlayContentService", () => {
|
||||
inlineMenuFieldQualificationService = new InlineMenuFieldQualificationService();
|
||||
domQueryService = new DomQueryService();
|
||||
domElementVisibilityService = new DomElementVisibilityService();
|
||||
inlineMenuContentService = mock<AutofillInlineMenuContentService>();
|
||||
autofillOverlayContentService = new AutofillOverlayContentService(
|
||||
domQueryService,
|
||||
domElementVisibilityService,
|
||||
inlineMenuFieldQualificationService,
|
||||
inlineMenuContentService,
|
||||
);
|
||||
autofillInit = new AutofillInit(
|
||||
domQueryService,
|
||||
|
@ -28,6 +28,7 @@ import {
|
||||
} from "../enums/autofill-overlay.enum";
|
||||
import AutofillField from "../models/autofill-field";
|
||||
import AutofillPageDetails from "../models/autofill-page-details";
|
||||
import { AutofillInlineMenuContentService } from "../overlay/inline-menu/abstractions/autofill-inline-menu-content.service";
|
||||
import { ElementWithOpId, FillableFormFieldElement, FormFieldElement } from "../types";
|
||||
import {
|
||||
currentlyInSandboxedIframe,
|
||||
@ -155,6 +156,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
||||
private domQueryService: DomQueryService,
|
||||
private domElementVisibilityService: DomElementVisibilityService,
|
||||
private inlineMenuFieldQualificationService: InlineMenuFieldQualificationService,
|
||||
private inlineMenuContentService?: AutofillInlineMenuContentService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@ -1580,7 +1582,8 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
||||
if (activeElement) {
|
||||
return (
|
||||
activeElement === this.mostRecentlyFocusedField ||
|
||||
activeElement.contains(this.mostRecentlyFocusedField)
|
||||
activeElement.contains(this.mostRecentlyFocusedField) ||
|
||||
this.inlineMenuContentService?.isElementInlineMenu(activeElement as HTMLElement)
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user