Skip to content

Commit 8284975

Browse files
committed
fix: replace Modal with FullWindowOverlay for improved blur handling
1 parent e45cc8f commit 8284975

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

example/app/(tabs)/index.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {
55
ImageBackground,
66
ScrollView,
77
Pressable,
8-
Modal,
98
TouchableWithoutFeedback,
109
View,
1110
} from 'react-native';
11+
import { FullWindowOverlay } from 'react-native-screens';
1212
import { BlurView } from '@sbaiahmed1/react-native-blur';
1313
import { DEMO_IMAGES } from '@/constants/blur';
1414

@@ -65,21 +65,23 @@ export default function HomeScreen() {
6565
</BlurView>
6666
</ScrollView>
6767

68-
<Modal visible={isModalVisible} transparent statusBarTranslucent>
69-
<TouchableWithoutFeedback onPress={() => setIsModalVisible(false)}>
70-
<BlurView
71-
ignoreSafeArea
72-
blurType={'dark'}
73-
style={StyleSheet.absoluteFill}
74-
/>
75-
</TouchableWithoutFeedback>
68+
{isModalVisible && (
69+
<FullWindowOverlay>
70+
<TouchableWithoutFeedback onPress={() => setIsModalVisible(false)}>
71+
<BlurView
72+
ignoreSafeArea
73+
blurType={'dark'}
74+
style={StyleSheet.absoluteFill}
75+
/>
76+
</TouchableWithoutFeedback>
7677

77-
<View style={styles.modalContent}>
78-
<View style={styles.modalCard}>
79-
<Text>Hello this is a centred text in a modal</Text>
78+
<View style={styles.modalContent} pointerEvents="none">
79+
<View style={styles.modalCard}>
80+
<Text>Hello this is a centred text in a modal</Text>
81+
</View>
8082
</View>
81-
</View>
82-
</Modal>
83+
</FullWindowOverlay>
84+
)}
8385
</ImageBackground>
8486
);
8587
}

0 commit comments

Comments
 (0)