You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My use case is a carousel inside a tab component. After I have traversed images in the carousel, I swap tabs and then swap back, adding a display none to the content that is in the inactive tab.
The position of the carousel seems to reset back to the first item. How can I keep the selected carousel item stable after show/hiding it?
Traverse carousel item to any but the first, then click the show / hide button to toggle display none, it will reset the carousel back to the first item.
Additional context
No response
The text was updated successfully, but these errors were encountered:
hybrid897
changed the title
Carousel position resetting when display none
Carousel position resetting when toggling visibility (display none)
Jun 21, 2024
Hi! The script reads the dimensions of the container to determine which slides to display. Therefore, if the container has no dimensions, it is assumed that there is nothing to display.
Describe the bug
My use case is a carousel inside a tab component. After I have traversed images in the carousel, I swap tabs and then swap back, adding a display none to the content that is in the inactive tab.
The position of the carousel seems to reset back to the first item. How can I keep the selected carousel item stable after show/hiding it?
Thank you.
Reproduction
https://stackblitz.com/edit/react-ts-pv5u2i
Traverse carousel item to any but the first, then click the show / hide button to toggle display none, it will reset the carousel back to the first item.
Additional context
No response
The text was updated successfully, but these errors were encountered: