diff --git a/src/components/Modal/BaseModal.js b/src/components/Modal/BaseModal.js index 1e314654bba3..7d44127f1c91 100644 --- a/src/components/Modal/BaseModal.js +++ b/src/components/Modal/BaseModal.js @@ -155,6 +155,7 @@ class BaseModal extends PureComponent { modalContainerStyleMarginBottom: modalContainerStyle.marginBottom, modalContainerStylePaddingTop: modalContainerStyle.paddingTop, modalContainerStylePaddingBottom: modalContainerStyle.paddingBottom, + insets, }); return ( diff --git a/src/styles/StyleUtils.js b/src/styles/StyleUtils.js index f614ab69185d..f78e56839e5b 100644 --- a/src/styles/StyleUtils.js +++ b/src/styles/StyleUtils.js @@ -440,15 +440,19 @@ function getModalPaddingStyles({ modalContainerStyleMarginBottom, modalContainerStylePaddingTop, modalContainerStylePaddingBottom, + insets, }) { + // use fallback value for safeAreaPaddingBottom to keep padding bottom consistent with padding top. + // More info: issue #17376 + const safeAreaPaddingBottomWithFallback = insets.bottom === 0 ? (modalContainerStylePaddingTop || 0) : safeAreaPaddingBottom; return { marginTop: (modalContainerStyleMarginTop || 0) + (shouldAddTopSafeAreaMargin ? safeAreaPaddingTop : 0), - marginBottom: (modalContainerStyleMarginBottom || 0) + (shouldAddBottomSafeAreaMargin ? safeAreaPaddingBottom : 0), + marginBottom: (modalContainerStyleMarginBottom || 0) + (shouldAddBottomSafeAreaMargin ? safeAreaPaddingBottomWithFallback : 0), paddingTop: shouldAddTopSafeAreaPadding ? (modalContainerStylePaddingTop || 0) + safeAreaPaddingTop : modalContainerStylePaddingTop || 0, paddingBottom: shouldAddBottomSafeAreaPadding - ? (modalContainerStylePaddingBottom || 0) + safeAreaPaddingBottom + ? (modalContainerStylePaddingBottom || 0) + safeAreaPaddingBottomWithFallback : modalContainerStylePaddingBottom || 0, paddingLeft: safeAreaPaddingLeft || 0, paddingRight: safeAreaPaddingRight || 0,