From 034b46cc710884a00264941d9e47caa1df29895f Mon Sep 17 00:00:00 2001 From: melloware Date: Sun, 22 Jan 2023 11:53:52 -0500 Subject: [PATCH] Fix #3973: Galleria stop show at end if not circular --- components/lib/galleria/Galleria.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/components/lib/galleria/Galleria.js b/components/lib/galleria/Galleria.js index ab0460f559..9296453908 100644 --- a/components/lib/galleria/Galleria.js +++ b/components/lib/galleria/Galleria.js @@ -4,7 +4,7 @@ import { CSSTransition } from '../csstransition/CSSTransition'; import { useInterval, useUnmountEffect } from '../hooks/Hooks'; import { Portal } from '../portal/Portal'; import { Ripple } from '../ripple/Ripple'; -import { classNames, DomHandler, ObjectUtils, ZIndexUtils } from '../utils/Utils'; +import { DomHandler, ObjectUtils, ZIndexUtils, classNames } from '../utils/Utils'; import { GalleriaItem } from './GalleriaItem'; import { GalleriaThumbnails } from './GalleriaThumbnails'; @@ -29,6 +29,13 @@ export const Galleria = React.memo( ); const onActiveItemChange = (event) => { + if (event.index >= props.value.length) { + // #3973 AutoPlay without circular should stop the slideshow when it reaches the end + stopSlideShow(); + + return; + } + if (props.onItemChange) { props.onItemChange(event); } else {