-
Notifications
You must be signed in to change notification settings - Fork 19
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
SpatialNavigationVirtualizedList default position #144
Comments
Hey! Using a little useEffect you should be able to add your default focus 😁 I'm closing, feel free to tell me if it's not enough! |
It's kinda okay, but the issue is that calling focus works with animation, and if I have like 2 lists, and I want to set default index to for example 3, entering screen is ugly, lists are moving, adding possibility to disable animation while imperatively focusing target element, would be awesome |
Makes sense! Let's reopen 😉 |
I was discussing this feature with the others. We were wondering: why would you need a default position that is not the position 0? We think that it's a little weird, because this might hide content from the user if the list is not at the beginning, right? |
Actually this is a very common practice among any kind of OTT applications, like: Banner -> showing "netflix" like banner with pagination dots, a lot of companies likes to set default item to idx=1 There are a lot of use cases |
OK, thank you for the very quick answer 🙌 |
Also I've noticed a problem when I've tried to implement workaround using .focus method on list ref When I have multiple lists that come from external API, and I call .focus on each of them (each of them have different initial position), there is a problem, in which I press any button, and focus is redirected automatically to last list, which is also not ideal |
Is your feature request related to a problem? Please describe.
Currently there is no way to set default/initial focus index on virtualized list
There is no even any ScrollTo method exposed
Describe the solution you'd like
Add prop for initial index, or expose anything like ScrollTo method
Describe alternatives you've considered
Wrapping stuff in
The text was updated successfully, but these errors were encountered: