From 624b9ddec0f0e6f13a5ea9ff43d9b332cf0ad101 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 4 Dec 2020 11:31:46 -0800 Subject: [PATCH] [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 --- packages/react-native-web/src/exports/Modal/ModalAnimation.js | 3 ++- packages/react-native-web/src/exports/Modal/ModalContent.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native-web/src/exports/Modal/ModalAnimation.js b/packages/react-native-web/src/exports/Modal/ModalAnimation.js index 3fb9f322..a7d9b16a 100644 --- a/packages/react-native-web/src/exports/Modal/ModalAnimation.js +++ b/packages/react-native-web/src/exports/Modal/ModalAnimation.js @@ -79,7 +79,8 @@ const styles = StyleSheet.create({ top: 0, right: 0, bottom: 0, - left: 0 + left: 0, + zIndex: 9999 }, animatedIn: { animationDuration: `${ANIMATION_DURATION}ms`, diff --git a/packages/react-native-web/src/exports/Modal/ModalContent.js b/packages/react-native-web/src/exports/Modal/ModalContent.js index 347e2fcf..2d34e190 100644 --- a/packages/react-native-web/src/exports/Modal/ModalContent.js +++ b/packages/react-native-web/src/exports/Modal/ModalContent.js @@ -55,8 +55,7 @@ const styles = StyleSheet.create({ top: 0, right: 0, bottom: 0, - left: 0, - zIndex: 9999 + left: 0 }, modalTransparent: { backgroundColor: 'transparent'