@@ -20,6 +20,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
2020import { handleBulkPayItemSelected } from '@libs/actions/Search' ;
2121import Navigation from '@libs/Navigation/Navigation' ;
2222import { isExpenseReport } from '@libs/ReportUtils' ;
23+ import shouldPopoverUseScrollView from '@libs/shouldPopoverUseScrollView' ;
2324import CONST from '@src/CONST' ;
2425import ONYXKEYS from '@src/ONYXKEYS' ;
2526import ROUTES from '@src/ROUTES' ;
@@ -76,8 +77,7 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
7677 const selectedTransactionsKeys = Object . keys ( selectedTransactions ?? { } ) ;
7778 const isExpenseReportType = queryJSON . type === CONST . SEARCH . DATA_TYPES . EXPENSE_REPORT ;
7879
79- const shouldPopoverUseScrollView =
80- headerButtonsOptions . length >= CONST . DROPDOWN_SCROLL_THRESHOLD || headerButtonsOptions . some ( ( option ) => ( option . subMenuItems ?. length ?? 0 ) >= CONST . DROPDOWN_SCROLL_THRESHOLD ) ;
80+ const popoverUseScrollView = shouldPopoverUseScrollView ( headerButtonsOptions ) ;
8181
8282 const selectedItemsCount = useMemo ( ( ) => {
8383 if ( ! selectedTransactions ) {
@@ -123,7 +123,7 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
123123 shouldAlwaysShowDropdownMenu
124124 isDisabled = { headerButtonsOptions . length === 0 }
125125 onPress = { ( ) => null }
126- shouldPopoverUseScrollView = { shouldPopoverUseScrollView }
126+ shouldPopoverUseScrollView = { popoverUseScrollView }
127127 onSubItemSelected = { ( subItem ) =>
128128 handleBulkPayItemSelected ( {
129129 item : subItem ,
@@ -163,7 +163,7 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
163163 buttonSize = { CONST . DROPDOWN_BUTTON_SIZE . SMALL }
164164 customText = { selectionButtonText }
165165 options = { headerButtonsOptions }
166- shouldPopoverUseScrollView = { shouldPopoverUseScrollView }
166+ shouldPopoverUseScrollView = { popoverUseScrollView }
167167 onSubItemSelected = { ( subItem ) =>
168168 handleBulkPayItemSelected ( {
169169 item : subItem ,
0 commit comments