mirror of
https://github.com/bitwarden/browser
synced 2026-02-13 15:03:26 +00:00
fix scroll positon after delete
This commit is contained in:
@@ -66,7 +66,6 @@ describe("ViewV2Component", () => {
|
||||
const back = jest.fn().mockResolvedValue(null);
|
||||
const openSimpleDialog = jest.fn().mockResolvedValue(true);
|
||||
const stop = jest.fn();
|
||||
const forceTopOnNextVaultStart = jest.fn();
|
||||
const showToast = jest.fn();
|
||||
const showPasswordPrompt = jest.fn().mockResolvedValue(true);
|
||||
const getFeatureFlag$ = jest.fn().mockReturnValue(of(true));
|
||||
@@ -115,7 +114,6 @@ describe("ViewV2Component", () => {
|
||||
doAutofill.mockClear();
|
||||
copy.mockClear();
|
||||
stop.mockClear();
|
||||
forceTopOnNextVaultStart.mockClear();
|
||||
openSimpleDialog.mockClear();
|
||||
back.mockClear();
|
||||
showToast.mockClear();
|
||||
@@ -136,7 +134,7 @@ describe("ViewV2Component", () => {
|
||||
{ provide: PopupRouterCacheService, useValue: mock<PopupRouterCacheService>({ back }) },
|
||||
{ provide: ActivatedRoute, useValue: { queryParams: params$ } },
|
||||
{ provide: EventCollectionService, useValue: { collect } },
|
||||
{ provide: VaultPopupScrollPositionService, useValue: { stop, forceTopOnNextVaultStart } },
|
||||
{ provide: VaultPopupScrollPositionService, useValue: { stop } },
|
||||
{ provide: VaultPopupAutofillService, useValue: mockVaultPopupAutofillService },
|
||||
{ provide: ToastService, useValue: { showToast } },
|
||||
{ provide: ConfigService, useValue: { getFeatureFlag$ } },
|
||||
|
||||
@@ -34,7 +34,7 @@ export class VaultPopupScrollPositionService {
|
||||
if (this.hasScrollPosition()) {
|
||||
// Use `setTimeout` to scroll after rendering is complete
|
||||
setTimeout(() => {
|
||||
scrollElement.scrollTo({ top: this.scrollPosition, behavior: "instant" });
|
||||
scrollElement.scrollTo({ top: this.scrollPosition!, behavior: "instant" });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user