Skip to content

Commit

Permalink
change visibleItems scrollY reffrence from window to it's container
Browse files Browse the repository at this point in the history
  • Loading branch information
liatv committed Dec 10, 2023
1 parent 83ec6c4 commit c8e2075
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ 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)
Expand Down

0 comments on commit c8e2075

Please sign in to comment.