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

Feature : support for a list of 2 items #8

Open
giboin opened this issue Jun 20, 2024 · 0 comments
Open

Feature : support for a list of 2 items #8

giboin opened this issue Jun 20, 2024 · 0 comments

Comments

@giboin
Copy link

giboin commented Jun 20, 2024

Description

Hi everyone, thanks for this amazing package!
Here is my problem : I need to display a slider of 2 elements like this :

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-20.at.16.18.47.mp4

(sorry for the performance of this demo, not my best work here 😅)

Because of the assert itemCountBefore + itemCountAfter +1 >= children.length, I need to specify either itemCountBefore = 0 or itemCountAfter = 0.
If I say that itemCountAfter = 0, then when the first item is selected, we don't see the second one.
If I say that itemCountBefore = 0, then when the second item is selected we won't see the first one.

Ideas on how to solve

  • We could allow to pass any value to itemCountAfter and itemCountBefore, and virtually add SizedBow.shrink to children (by virtually I mean that they are rendered by the slider but the controller and the scrollPosition can't go to them)
  • Maybe find a way to keep rendering every children that stay on the screen, so that I can say itemCountAfter = 1 and itemCountBefore = 0 but the first item doesn't disappear when the second one is selected

Thank you!

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