Skip to content

Commit

Permalink
add animation duration to navigate toIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
noam-heller1 committed Apr 4, 2024
1 parent 5e115eb commit 75129f0
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -857,12 +857,13 @@ class SlideshowView extends React.Component {
}
};
createOrGetCustomNavigationPanelAPI = () => {
console.log('createOrGetCustomNavigationPanelAPI!!!!!!!!');
const isRTL =
this.props.options.behaviourParams_gallery_layoutDirection ===
GALLERY_CONSTS[optionsMap.behaviourParams.gallery.layoutDirection].RIGHT_TO_LEFT;
if (!this.navigationPanelAPI) {
this.navigationPanelAPI = {
next: () =>
next: () =>
this.next({
scrollDuration: 400,
isKeyboardNavigation: false,
Expand Down Expand Up @@ -891,7 +892,10 @@ class SlideshowView extends React.Component {
},
triggerItemAction: (e, { itemIndex = this.state.activeIndex } = {}) => {
const galleryConfig = this.createGalleryConfig();
const item = this.props.galleryStructure.galleryItems[itemIndex % this.props.totalItemsCount];
const item =
this.props.galleryStructure.galleryItems[
itemIndex % this.props.totalItemsCount
];
const props = item?.renderProps({
...galleryConfig,
visible: true,
Expand All @@ -902,7 +906,8 @@ class SlideshowView extends React.Component {
// nextGroup,
// previousItem,
// previousGroup,
toIndex: (itemIdx) => this.scrollToIndex({ itemIdx, scrollDuration: 400 }),
toIndex: (itemIdx, animationDuration = 400) =>
this.scrollToIndex({ itemIdx, scrollDuration: animationDuration }),
// getCurrentActiveItemIndex,
// getCurrentActiveGroupIndex,
assignIndexChangeCallback: (func) => {
Expand Down

0 comments on commit 75129f0

Please sign in to comment.