Skip to content

Commit

Permalink
Show all relevant thumbnails (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
Galpittel authored Aug 18, 2024
1 parent c05bcb6 commit 90f2d8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class NavigationPanel extends React.Component {
style={{ ...thumbnailsStyle }}
>
{items.map(({ thumbnailItem, location, idx }) => {
const highlighted = idx === activeIndex % items.length;
const highlighted = idx === activeIndex % clearedGalleryItems.length;
const itemStyle = {
width: options[optionsMap.layoutParams.thumbnails.size],
height: options[optionsMap.layoutParams.thumbnails.size],
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/core/helpers/thumbnailsLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function getThumbnailsData({
const numberOfThumbnails = minNumOfThumbnails % 2 === 1 ? minNumOfThumbnails : minNumOfThumbnails + 1;
const thumbnailsInEachSide = (numberOfThumbnails - 1) / 2;

const itemRangeStart = activeIndexWithOffset - thumbnailsInEachSide;
const itemRangeStart = (activeIndexWithOffset % galleryItems.length) - thumbnailsInEachSide;
const itemRangeEnd = itemRangeStart + numberOfThumbnails;

const itemToDisplay = withInfiniteScroll
Expand Down

0 comments on commit 90f2d8d

Please sign in to comment.