react-native-modal: [Android]: OnPress not working when modal is open after updating react native version
OnPress not working while modal is open after updating react native version, not on presseble and neither on TouchableOpacity, tried swapping it with built in modal and it worked, I think there is issue with newer components and modal. Also focusing on textinput is not working when modal is open. scroll works perfectly.
Environment
react-native: 0.71.4 react: 18.2.0
Platforms
only on android, tested on galaxy s22
Versions
- Android: 13
- iOS:
- react-native-modal:^13.0.1
- react-native:0.71.4
- react:18.2.0
Description
it is suck on open screen, I can open and close modal without problem but I cant press anything. Flatlist works fine.
Reproducible Demo
<Modal isVisible={visible} onBackdropPress={hide} onSwipeComplete={hide} swipeDirection="down" propagateSwipe={true} style={styles.modal} animationOutTiming={500} backdropTransitionInTiming={300} onModalHide={onModalHide} hideModalContentWhileAnimating useNativeDriver useNativeDriverForBackdrop onDismiss={onDismiss} // coverScreen={false} > <Pressable onPress={() => console.log('first')} onLongPress={() => console.log('long')} unstable_pressDelay={0} style={{ backgroundColor: 'red', height: 100, width: 100 }} > <Text>asd</Text> </Pressable> <AppToast /> </Modal>
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 7
- Comments: 20
Wrapping the Modal in a View solved the problem for me in RN 0.71.8
yesss thank you dear!!!
It’s working for default RN modal too 🎉
yes wrapping with View , helped me , thank you @rizshivalli
worked in 0.75 > 0.76 migration
onPress does not work even wrapping the modal with a View. New architecture, RN 0.72.5