Skip to content

Conversation

@thanhcuong1990
Copy link

@thanhcuong1990 thanhcuong1990 commented Dec 5, 2025

Summary

This PR fixes an issue where currentIndex could go out of bounds, leading to incorrect state updates or unexpected UI behavior.
It addresses issue #14.

Changes
• Clamped currentIndex to ensure it always stays within valid bounds.
• Updated all related state and logic to use the clamped value.
• Minor refactor to improve code clarity and prevent similar issues.

Impact
• Prevents crashes or visual glitches when navigating beyond the valid index range.
• Ensures consistent behavior across all components relying on currentIndex.

Testing
• Verified correct behavior at boundary indices (first and last).
• Confirmed no regressions during normal carousel navigation.

…update all related state and logic to use the clamped value.
@frodriguez-hu
Copy link
Collaborator

@thanhcuong1990 Hey! Would you mind uploading videos with Before and After? I mean a video showing the issue and other showing how this fix it. Thanks for the pr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants