From 752445e3153603b5e7fb6747f5a7808855371065 Mon Sep 17 00:00:00 2001 From: Wendy Date: Wed, 11 Feb 2026 12:48:07 +0100 Subject: [PATCH] feat(hideBackdrop) implement feature to hide the backdrop with showBackdrop prop --- src/ModalView.tsx | 35 +++++++++++++++++++---------------- src/ModalView.web.tsx | 35 +++++++++++++++++++---------------- src/types.ts | 6 ++++++ 3 files changed, 44 insertions(+), 32 deletions(-) diff --git a/src/ModalView.tsx b/src/ModalView.tsx index f7ebe92..bdac54b 100644 --- a/src/ModalView.tsx +++ b/src/ModalView.tsx @@ -24,6 +24,7 @@ export const ModalView: FC = ({ onRequestDismiss, contentContainerStyle, statusBar, + showBackdrop = true, BackdropPressableComponent = Pressable, backdropColor = defaultBackdropColor, disableDefaultStatusBarIOS = false, @@ -44,22 +45,24 @@ export const ModalView: FC = ({ ) : null} - - onRequestDismiss?.(DismissalSource.Backdrop)} - > - {renderBackdrop ? ( - renderBackdrop() - ) : ( - - )} - - + {showBackdrop && ( + + onRequestDismiss?.(DismissalSource.Backdrop)} + > + {renderBackdrop ? ( + renderBackdrop() + ) : ( + + )} + + + )} = ({ renderBackdrop, onRequestDismiss, contentContainerStyle, + showBackdrop = true, BackdropPressableComponent = Pressable, backdropColor = defaultBackdropColor, animationType = 'none', @@ -57,22 +58,24 @@ export const ModalView: FC = ({ }, [animationType, modalIsOpen]); return createPortal( - - onRequestDismiss?.(DismissalSource.Backdrop)} - > - {renderBackdrop ? ( - renderBackdrop() - ) : ( - - )} - + + {showBackdrop && ( + onRequestDismiss?.(DismissalSource.Backdrop)} + > + {renderBackdrop ? ( + renderBackdrop() + ) : ( + + )} + + )}