-
Notifications
You must be signed in to change notification settings - Fork 13
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
Checking if the element is already in view? #6
Comments
Hi I understand the usecase I could add a method to know weither the view is above, under or into view, but this would be imperative so you would have to wire it in a on scroll JS listener. Would it be fine? On holiday 2 weeks so won't be able to work on this soon |
Hi For this usecase I think you should use an animated value on scrollY and hide the Fab if scrollY is > some threshold. This lib is not made for tracking visibility state of elements over time and it's likely to be less performant for your usecase as it cant run fully on the native side |
@slorber Actually, my use case is more analog to |
I guess you can yes but sometimes you may want to prefer using a ScrollView, depends if you want virtualization or not. About your usecase @jsamr I think it may be complicated to efficiently track the position of those items in the view over time but I can see what's possible, have some ideas for that. What API do you have in mind? Something like that? I guess we should be able to
|
But I feel this feature does not really belong to this lib and could be more useful in a separate lib. I'm thinking of splitting it this way: Some primitives:
Some libs for user consumption:
I also feel like the primitives could be used in https://github.com/APSL/react-native-keyboard-aware-scroll-view @alvaromb what do you think of this idea? |
Use case:
There is a fixed button on bototm of the screen that scrolls into a View when pressed on. However, I want to hide that button if the element has already been scrolled to manually. Is there a way to see if my element is already at the current scroll position?
My code:
Thanks
The text was updated successfully, but these errors were encountered: