File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ function ButtonWithDropdownMenu<IValueType>({
5151 secondLineText = '' ,
5252 icon,
5353 shouldUseModalPaddingStyle = true ,
54+ shouldHandleNavigationBack = true ,
5455} : ButtonWithDropdownMenuProps < IValueType > ) {
5556 const theme = useTheme ( ) ;
5657 const styles = useThemeStyles ( ) ;
@@ -221,6 +222,7 @@ function ButtonWithDropdownMenu<IValueType>({
221222 setIsMenuVisible ( false ) ;
222223 onOptionsMenuHide ?.( ) ;
223224 } }
225+ shouldHandleNavigationBack = { shouldHandleNavigationBack }
224226 onModalShow = { onOptionsMenuShow }
225227 onItemSelected = { ( selectedSubitem , index , event ) => {
226228 onSubItemSelected ?.( selectedSubitem , index , event ) ;
Original file line number Diff line number Diff line change @@ -142,6 +142,9 @@ type ButtonWithDropdownMenuProps<TValueType> = {
142142
143143 /** Whether to use modal padding style for the popover menu */
144144 shouldUseModalPaddingStyle ?: boolean ;
145+
146+ /** Whether handle navigation back when modal show. */
147+ shouldHandleNavigationBack ?: boolean ;
145148} ;
146149
147150export type {
Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ type PopoverMenuProps = Partial<PopoverModalProps> & {
158158
159159 /** Used to locate the component in the tests */
160160 testID ?: string ;
161+
162+ /** Whether handle navigation back when modal show. */
163+ shouldHandleNavigationBack ?: boolean ;
161164} ;
162165
163166const renderWithConditionalWrapper = ( shouldUseScrollView : boolean , contentContainerStyle : StyleProp < ViewStyle > , children : ReactNode ) : React . JSX . Element => {
@@ -209,6 +212,7 @@ function PopoverMenu({
209212 shouldUseModalPaddingStyle,
210213 shouldAvoidSafariException = false ,
211214 testID,
215+ shouldHandleNavigationBack,
212216} : PopoverMenuProps ) {
213217 const styles = useThemeStyles ( ) ;
214218 const theme = useTheme ( ) ;
@@ -405,6 +409,7 @@ function PopoverMenu({
405409 setEnteredSubMenuIndexes ( CONST . EMPTY_ARRAY ) ;
406410 onClose ( ) ;
407411 } }
412+ shouldHandleNavigationBack = { shouldHandleNavigationBack }
408413 isVisible = { isVisible }
409414 onModalHide = { handleModalHide }
410415 onModalShow = { onModalShow }
You can’t perform that action at this time.
0 commit comments