react-native-raw-bottom-sheet
react-native-raw-bottom-sheet copied to clipboard
Press Events still not work
Hi,
I am trying to add a touchable opacity inside RBSheet and strangely not press event working.
I have read the other thread regarding the TouchableOpacity import so my import is from 'react-native' Please suggest fix for it.
Thanks, Ali
I have the same problem.
Also actual for me
Same problem, still no solution?
It's working for me now, I don't remember what i done . But I guess I put all content of the RBSheet inside a view worked for me.
I've been noticing that if I use TouchableOpacity directly in the RBSheet it works fine but if I try to render a sub component is when it stops working. Not sure if this is the same issue?
TouchableOpacity worked for me.
<RBSheet
ref={bottomSheetRef}
height={BOTTOM_SHEET_HEIGHT}
customStyles={{
container: {
backgroundColor: 'transparent',
},
}}
openDuration={250}>
<BottomSheetContainer>
<SheetHeader>{title}</SheetHeader>
<PickerContainer>
<DatePicker
fadeToColor={theme.colorsGallery.grayColors.dark1}
textColor={theme.colorsGallery.solidColors.orange}
is24hourSource="locale"
locale={'pt_BR'}
androidVariant="iosClone"
date={date}
mode={mode}
onDateChange={setDate}
/>
</PickerContainer>
<ButtonContainer>
<TouchableOpacity onPress={handleCancel}>
<RoundedButton
useLargeText
title="Fechar"
colorTintTheme="default"
filled
/>
</TouchableOpacity>
<TouchableOpacity onPress={save}>
<RoundedButton
useLargeText
title="Salvar"
colorTintTheme="primaryGradientColor"
filled
/>
</TouchableOpacity>
</ButtonContainer>
</BottomSheetContainer>
</RBSheet>
Yes, this RoundedButton
is already a TouchableOpacity but I don't know why it wasn't working so I put the RoundedButton
as children of a TouchableOpacity and now it's working.
If it persists in newer versions of react-native, please open a new issue.