Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHOT-3807] - calculate which visibleItems to present from the gallery scroll container instead of window top. #1177

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,15 @@ export class GalleryContainer extends React.Component {

getVisibleItems(items, container, isPrerenderMode) {
const { gotFirstScrollEvent } = this.state;
const scrollY = window.scrollY;
const scrollY = this.state?.scrollPosition?.top || 0;
const { galleryHeight, scrollBase, galleryWidth } = container;
if (
isPrerenderMode || // (used to be isSSR, had a hydrate bug, isPrerenderMode is the way to go in terms of hydrate issues)
isSEOMode() ||
isEditMode() ||
gotFirstScrollEvent ||
scrollY > 0 ||
isPreviewMode() ||
this.props.activeIndex > 0
) {
return items;
Expand Down
Loading