Android does not scroll
Hi,
Works great on iOS devices when I use it with the @gorhom/react-native-wheely repo. But it does not scroll on Android devices.
IOS Working:
https://user-images.githubusercontent.com/26353461/151627950-7855d5b6-8a77-4e2c-a1e3-58ff56fb1560.mp4
Android Not Working:
https://user-images.githubusercontent.com/26353461/151628009-64e37565-75b8-4540-b166-acd81cba0297.mp4
Example Code:
import React, {useCallback,useRef,useMemo) from 'react'
import BottomSheet, {
BottomSheetView
} from '@gorhom/bottom-sheet';
import WheelPicker from 'react-native-wheely';
const Example = () => {
const snapPoints = useMemo(() => ['30%', '50%', '60%', '90%'], []);
const renderBackdrop = useCallback(
props => (
<BottomSheetBackdrop
disappearsOnIndex={-1}
appearsOnIndex={0}
{...props}
/>
),
[],
);
const ref = useRef(null);
const handleSheetChanges = useCallback(index => {
console.log('handleSheetChange', index);
}, []);
const handleSnapPress = useCallback((index, refId) => {
console.log('handleSnapPress', index, refId);
ref.current?.snapToIndex(index);
}, []);
const handleClosePress = useCallback(refId => {
ref.current?.close();
}, []);
return(
<View>
<BottomSheet
index={1}
backdropComponent={backdropComponent}
animateOnMount={true}
enablePanDownToClose={true}
keyboardBehavior="extend"
handleIndicatorStyle={{
backgroundColor: '#E4E7EC',
width: scale(70),
}}
handleStyle={{backgroundColor: '#F9FAFB', borderRadius: 10}}
ref={ref}
snapPoints={snapPoints}
onChange={handleSheetChanges}>
<BottomSheetView>
<WheelPicker
selectedIndex={selectedIndex}
containerStyle={styles.container}
selectedIndicatorStyle={styles.selectedIndicator}
itemTextStyle={styles.itemText}
itemStyle={styles.item}
options={options}
onChange={onChange}
/>
</BottomSheetView>
</BottomSheet>
</View>
)
}
Dependency
"@gorhom/bottom-sheet": "^4.1.5",
"react-native-reanimated": "^2.3.1",
"react-native-gesture-handler": "^2.1.1",
"react-native-wheely": "^0.3.2",
@mehderilker: hello! :wave:
This issue is being automatically closed because it does not follow the issue template.
Have you solved it?
I am facing the same issue
Have you solved it?
No, I couldn't solve it.
worked for me by wrapping with gestureHandlerRootHOC from react-native-gesture-handler
worked for me by wrapping with
gestureHandlerRootHOCfrom react-native-gesture-handler
Wrapping what? I tried to do this and now I have a GestureView covering half the screen making this solution unusable.
worked for me by wrapping with
gestureHandlerRootHOCfrom react-native-gesture-handlerWrapping what? I tried to do this and now I have a GestureView covering half the screen making this solution unusable.
Ok, I was able to fix this by wrapping the entire screen component in gestureHandlerRootHOC
worked for me by wrapping with
gestureHandlerRootHOCfrom react-native-gesture-handlerWrapping what? I tried to do this and now I have a GestureView covering half the screen making this solution unusable.
Ok, I was able to fix this by wrapping the entire screen component in
gestureHandlerRootHOC
that's it, sorry a bit late, this is how it worked for me:
const ExploreScreen = gestureHandlerRootHOC(() => {
...
return (
<BottomSheet
enableHandlePanningGesture={true}
enableContentPanningGesture={true}
...
>
<BottomSheetFlatList .... />
</BottomSheet>
);
});
Why this solution works?
worked for me by wrapping with
gestureHandlerRootHOCfrom react-native-gesture-handlerWrapping what? I tried to do this and now I have a GestureView covering half the screen making this solution unusable.
Ok, I was able to fix this by wrapping the entire screen component in
gestureHandlerRootHOC
This didnt work for me and neither did using the BottomSheetFlatlist. When I use it the list is blank, though I do see it passing data to each render item.
for me, i have to wrapping the entire screen component in gestureHandlerRootHOC and setting enableContentPanningGesture={false}
I try to wrap the App component in gestureHandlerRootHOC and it works
gestureHandlerRootHOC = wrap app by GestureHandleRootView though
enableContentPanningGesture={false} on BottomSheet worked for me 👍