Open pankti16 opened 3 years ago
hi @Pankti16 , what's your react-native version?
if your version is below 0.62 please either using ref.getNode()
in
listRefArr.current.push({
key: route.key,
value: ref, // replace to ref.getNode()
});
or
changing item.value.scrollToOffset
to item.value.getNode().scrollToOffset
instead.
Hi @JungHsuan , my react native version is 0.63.2
@Pankti16 OK, I see. Your problem is that offsets between tabs are not synced correctly, right? I will try to run your code later.
@JungHsuan Yes, thank you.
@Pankti16 hi, Here is my recording of your code running on iOS simulator. I removed all images and icon since I don't have the sources. I think that is what you expect, right?
@JungHsuan Hi, yes exactly. How did you manage it?
hi @Pankti16 , what's your react-native version? if your version is below 0.62 please either using
ref.getNode()
inlistRefArr.current.push({ key: route.key, value: ref, // replace to ref.getNode() });
or changing
item.value.scrollToOffset
toitem.value.getNode().scrollToOffset
instead.
work for me! Thank u 👍
I have same problem, any solution ? item.value.scrollToOffset not scroll
"react-native": "0.63.2",
my version
@thanhdevapp
Hi, did you mean that the position of tab is not properly synced?
I just update a new version, please check the file headerScrollableDemo.js
.
@thanhdevapp Hi, did you mean that the position of tab is not properly synced? I just update a new version, please check the file
headerScrollableDemo.js
.
New update not working for me. I'm getting ExceptionsManager.js:86 item.value.scrollToOffset is not a function
error.
@JungHsuan
hi @Pankti16 , what's your react-native version? if your version is below 0.62 please either using
ref.getNode()
inlistRefArr.current.push({ key: route.key, value: ref, // replace to ref.getNode() });
or changing
item.value.scrollToOffset
toitem.value.getNode().scrollToOffset
instead.work for me! Thank u 👍
What's your react-native version?
hi @Pankti16 , what's your react-native version? if your version is below 0.62 please either using
ref.getNode()
inlistRefArr.current.push({ key: route.key, value: ref, // replace to ref.getNode() });
or changing
item.value.scrollToOffset
toitem.value.getNode().scrollToOffset
instead.work for me! Thank u 👍
What's your react-native version?
My RN version is 60.6. I added item.value.getNode().scrollToOffset
but i got same error ExceptionsManager.js:86 item.value.getNode is not a function
. Please help me.
@JungHsuan
I think my problem is that in the view of tab 1
in tabview
there is Animated.ScrollView
inside so it causes this error.
If I have 2 tabs as 2 flastlist like example then it works normally. I don't know how to fix it.
I have found a solution. Because ScrollView has no scrollToOffset
function but only scrollTo
function, it is necessary to check the current component type run time if it is ScrollView.
when i scroll-up 1st tab header goes up and when i am clicling on sconed tab it's showing me space between header and list.and I am using AnimatedKeyboardawarescrollview for me scrollTooffset is not working. please HELP . Thanks in Adavnce.
item.value.getNode().scrollToOffset and item.value.scrollToOffset not working for me. please suggest what should i use in pleace of that using AnimatedKeyboardawarescrollview.
React native version 0.64
@JungHsuan @doanbh
Hi @aroravinay4 Are you using this https://github.com/APSL/react-native-keyboard-aware-scroll-view ?
Could you try item.value._component.scrollToOffset({ offset: 0, animated: false });
Thanks!
Hi @JungHsuan
i am using react-native-keyboard-aware-scroll-view and converted into const AnimatedKeyboardAwareScrollView = Animated.createAnimatedComponent( KeyboardAwareScrollView, ); for the tab animation and when i use as suggested above code snippet i got attached errror.
Same error occuer when i use item.value.scrollToOffse.
Hi @JungHsuan
i am using react-native-keyboard-aware-scroll-view and converted into const AnimatedKeyboardAwareScrollView = Animated.createAnimatedComponent( KeyboardAwareScrollView, ); for the tab animation and when i use as suggested above code snippet i got attached errror.
![]()
Same error occuer when i use item.value.scrollToOffse.
Hi @aroravinay4
Could you call scrollToOffset
by getting the ref of AnimatedKeyboardAwareScrollView
?
const scrollViewRef = useRef(null);
<AnimatedKeyboardAwareScrollView
ref={ref => scrollViewRef.current = ref }
/>
and try: scrollViewRef.current.scrollToOffset()
scrollToOffset is a props of VirtualizedList
Maybe you should try scrollTo for react-native-keyboard-aware-scroll-view
ScrollOffset does not sync fo each route, below is my code