Carousel out of Range Exception when loading shorter DataList while on last page(s) and navigating #1459

Closed
opened 2026-01-29 17:53:55 +00:00 by claunia · 3 comments
Owner

Originally created by @Anspitzen on GitHub (Nov 4, 2024).

Describe the bug
Radzen Carousel index will be out of bound if you load a new list which is shorter than current Index

To Reproduce
Steps to reproduce the behavior:

  1. Create a default Carousel, best with Auto = false for easier timing
  2. Go to the End of the carousel (highest index)
  3. Load new data list, which is shorter than current into the bound variable
  4. Now the carousel should update and show less index points for navigation without any of them being marked as active. But as Index is still too high you can't navigate as it is ArgumentOutOfRangeExeption on the "next" button.

On Auto=true it will be simply stuck on the last item of the list, but will be harder to time for reproducing.

Easy way to reproduce same error:

  1. Go to official Demo for carousel
  2. Add/Change button for manual navigation to jump to an index out of range (Count() + 1 for example)
    (Build it to run)
  3. Click that "wrong" button

Expected behavior
Not getting stuck or crashing. Should just jump to first item if out of range is called.

Desktop (please complete the following information):

  • Browser Chrome
  • Radzen Version 5.5.3

Additional context
Clicking on any of the available pager points is working, it will jump to the correct item.
But even going to previos item can be out of range, if the new list is still shorter.

Originally created by @Anspitzen on GitHub (Nov 4, 2024). **Describe the bug** Radzen Carousel index will be out of bound if you load a new list which is shorter than current Index **To Reproduce** Steps to reproduce the behavior: 1. Create a default Carousel, best with Auto = false for easier timing 2. Go to the End of the carousel (highest index) 3. Load new data list, which is shorter than current into the bound variable 4. Now the carousel should update and show less index points for navigation without any of them being marked as active. But as Index is still too high you can't navigate as it is ArgumentOutOfRangeExeption on the "next" button. On Auto=true it will be simply stuck on the last item of the list, but will be harder to time for reproducing. **Easy way to reproduce same error:** 1. Go to official Demo for carousel 2. Add/Change button for manual navigation to jump to an index out of range (Count() + 1 for example) (Build it to run) 4. Click that "wrong" button **Expected behavior** Not getting stuck or crashing. Should just jump to first item if out of range is called. **Desktop (please complete the following information):** - Browser Chrome - Radzen Version 5.5.3 **Additional context** Clicking on any of the available pager points is working, it will jump to the correct item. But even going to previos item can be out of range, if the new list is still shorter.
Author
Owner

@Anspitzen commented on GitHub (Nov 4, 2024):

I tried my hand at a Pull Request for a fix. (#1770)
As it is my first try on GitHub doing this please let me know if I should go about it in a different way.

@Anspitzen commented on GitHub (Nov 4, 2024): I tried my hand at a Pull Request for a fix. (#1770) As it is my first try on GitHub doing this please let me know if I should go about it in a different way.
Author
Owner

@enchev commented on GitHub (Nov 5, 2024):

Thanks for the pull request @Anspitzen! I think there is a more general way to fix this - I'll push it directly.

@enchev commented on GitHub (Nov 5, 2024): Thanks for the pull request @Anspitzen! I think there is a more general way to fix this - I'll push it directly.
Author
Owner

@Anspitzen commented on GitHub (Nov 5, 2024):

Need to ask here: Will that commit not break the timer?
GoTo(selectedIndex + 1) will not jump back to first item as it is simply out of range.

@Anspitzen commented on GitHub (Nov 5, 2024): Need to ask here: Will that commit not break the timer? GoTo(selectedIndex + 1) will not jump back to first item as it is simply out of range.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1459