gh-13024: Fixed restoring tab state also taking into account scroll (gh-13034)

This commit is contained in:
mr. m
2026-04-01 12:56:05 +02:00
committed by GitHub
parent e32ff53d2d
commit 69e3a995ae

View File

@@ -427,6 +427,11 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
state.image = tab.zenStaticIcon || initialState.image;
state.index = 0;
// See gh-13024, we need to remove the scroll position from the state,
// otherwise when we reset the pinned tab, it will scroll to the previous position
// which can be confusing for the user, especially if they have a long page.
delete state.scroll;
SessionStore.setTabState(tab, state);
this.resetPinChangedUrl(tab);
}