Closed BarthelemyPassinCauneau closed 3 years ago
Hi @BarthelemyPassinCauneau ! Thank you for raising this issue!
I will check it tomorrow!
Hi @BarthelemyPassinCauneau !
I think I understood this issue. The index
prop for specifying the initial index. I am sorry that I did not make this clear in the documentation. I think it is not possible to totally control the carousel as of now.
Hi! @BarthelemyPassinCauneau I assume you could instead use the goToIndex(index) on ref instead of passing the index as a prop. As an example:
const carouselRef = useRef(null);
const openGalleryAtIndex = (index) => {
console.log('index is..', index);
if (carouselRef.current !== null) {
carouselRef.current.goToIndex(index);
carouselRef.current.maximize();
}
};
....
<Carousel ref={carouselRef} />
Hi @acewebsolutions ! Thanks for your suggestions! 😀
Describe the bug I'm giving to the carousel the index parameter since I want to totally control the carousel. The bug is if I slide the carousel but for some external reason in my program I dont want the index to change, the image will still change but the arrows and dot buttons will still be corrects and remains at the right index.
To Reproduce Steps to reproduce the behavior:
Expected behavior Since the props index is passed, the displayed image should follow the index and shouldn't have it's own behavior.
Desktop: