-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Carousel control crashes on addition without initial items #905
Comments
can you provide a demo, i can not reproduce this issue |
Hi, I am on holidays. I will provide a demo once I am back on my machine. |
hello? |
@SamirKharchi Are you back?😅 |
Hi guys! sorry for the delay (had tons of work crashing on me after holidays, then it slipped my mind). I keep it in our version of HandyControl but it probably is not a necessary fix. So rry for keeping this pending for so long. |
ItemsSource 发生变化后 |
Describe the bug
The carousel control crashes when it has no items initially and one adds items afterwards.
To Reproduce
Expected behavior
No crash.
Additional context
Debugging shows that
Carousel.UpdateItemsPosition()
is crashing once it tries to use thePageIndex
, which is -1 at that point and therefore of course out-of-bounds.Possible fix is to update the
PageIndex
to an in-bounds range value when an item is added.The text was updated successfully, but these errors were encountered: