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

NavigationAwareScrollable does not proxy some of ScrollView methods #7626

Closed
ikhilko opened this issue Nov 8, 2018 · 1 comment · Fixed by react-navigation/native#8
Closed

Comments

@ikhilko
Copy link

ikhilko commented Nov 8, 2018

Current Behavior

react-navigation provides FlatList/SectionList/ScrollView with navigation aware behavior. To be able this working you are replacing underlying scroll component with wrapped into createNavigationAwareScrollable component. But looks like this broke some functionality, because VirtualizedList (used inside scrollable components provided by RN) are relying on calling some methods of scrollable via ref. Looks like wrapped into createNavigationAwareScrollable component doesn't proxy needed methods.

This actually broke some api's of underlying RN VirtualizedList: scrollToEnd, scrollToIndex, scrollToOffset, flashScrollIndicators, getScrollResponder , getScrollableNode , setNativeProps

Expected Behavior

FlatList/SectionList provided by react-navigation should provide all underlying functionality of RN scrollable's.

How to reproduce

I've prepared a demo:
https://snack.expo.io/@ikhilko/broken-api-of-scrollables

When you click on card in FlatList, I'm calling this.listRef.current.scrollToOffset method and it's broken

Your Environment

software version
react-navigation 3.0.0-rc.5
expo 31.0.4
node v9.11.2
npm or yarn yarn

If you want I can create a PR, but maybe it's need to be discussed a bit here

@pontusab
Copy link

@satya164 satya164 transferred this issue from react-navigation/native Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants