Skip to content
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

With dynamic input, pager view assumes the new added element is at the end and not at the beginning. #808

Open
sirusbaladi opened this issue Feb 12, 2024 · 0 comments

Comments

@sirusbaladi
Copy link

if we pass an array and we update the array adding a new element at the beginning of the array, native pager assumes that the element is added at the end. There should be an option to edit this.

This causes various bugs:

  • setPage doesn't work. Calling setPage(0) actually scrolls to the second element given that a new one was added but it's not take into account.
  • the scroll dots go out of sync.

The code is simply the standard example of PagerView but passing an array with an extra element at the beginning dynamically.

@sirusbaladi sirusbaladi changed the title setPage / OnPageScroll / internat state wrong with dynamic input. setPage / OnPageScroll / internal state wrong with dynamic input. Feb 12, 2024
@sirusbaladi sirusbaladi changed the title setPage / OnPageScroll / internal state wrong with dynamic input. setPage / OnPageScroll / internal state wrong with dynamic input. Assumes added element at the end and not at the beginning. Feb 12, 2024
@sirusbaladi sirusbaladi changed the title setPage / OnPageScroll / internal state wrong with dynamic input. Assumes added element at the end and not at the beginning. With dynamic input, pager view assumes the new added element is at the end and not at the beginning. Feb 12, 2024
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

No branches or pull requests

1 participant