-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fix for CarouselView not scrolling to the last item after data reset despite CurrentItem being updated #31672
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
base: main
Are you sure you want to change the base?
Conversation
…ata reset despite CurrentItem being updated
Hey there @@SyedAbdulAzeemSF4852! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
|
||
var diffToStart = currentCarouselPosition + (itemSourceCount - newPosition); | ||
var diffToEnd = itemSourceCount - currentCarouselPosition + newPosition; | ||
var diffToStart = (currentCarouselPosition - newPosition + itemSourceCount) % itemSourceCount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can also validate the position bounds, before use it:
if (newPosition < 0 || newPosition >= itemSourceCount)
return -1;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz , As suggested, I validated the position bounds before using it.
App.Tap("Issue23023_ReloadItems"); | ||
App.Tap("Issue23023_ScrollToLastItem"); | ||
|
||
VerifyScreenshot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending snapshots in some platforms, running a build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuarezruiz , I have added the pending snapshot for the Mac platform.
…ing snapshot for the Mac platform
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issue Details :
Root Cause:
Description of Change
Issues Fixed
Fixes #23023
Validated the behaviour in the following platforms
Output
Before.mov
After.mov