Skip to content

Commit 624b9dd

Browse files
committed
[fix] Modal z-index
The z-index must be applied to the outer element (or even the portal element) if the portal is to stack relative to other silbings. Previously, the z-index was only relative to the outer Modal element which had a non-static position. Fix #1820
1 parent 1b2bb16 commit 624b9dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/react-native-web/src/exports/Modal/ModalAnimation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ const styles = StyleSheet.create({
7979
top: 0,
8080
right: 0,
8181
bottom: 0,
82-
left: 0
82+
left: 0,
83+
zIndex: 9999
8384
},
8485
animatedIn: {
8586
animationDuration: `${ANIMATION_DURATION}ms`,

packages/react-native-web/src/exports/Modal/ModalContent.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ const styles = StyleSheet.create({
5555
top: 0,
5656
right: 0,
5757
bottom: 0,
58-
left: 0,
59-
zIndex: 9999
58+
left: 0
6059
},
6160
modalTransparent: {
6261
backgroundColor: 'transparent'

0 commit comments

Comments
 (0)