diff --git a/src/components/ButtonWithDropdownMenu/index.tsx b/src/components/ButtonWithDropdownMenu/index.tsx index ddab08bdc1d3..1ff0eaae4726 100644 --- a/src/components/ButtonWithDropdownMenu/index.tsx +++ b/src/components/ButtonWithDropdownMenu/index.tsx @@ -39,6 +39,7 @@ function ButtonWithDropdownMenu({ enterKeyEventListenerPriority = 0, wrapperStyle, useKeyboardShortcuts = false, + shouldUseStyleUtilityForAnchorPosition = false, defaultSelectedIndex = 0, shouldShowSelectedItemCheck = false, }: ButtonWithDropdownMenuProps) { @@ -175,7 +176,7 @@ function ButtonWithDropdownMenu({ }} onModalShow={onOptionsMenuShow} onItemSelected={() => setIsMenuVisible(false)} - anchorPosition={popoverAnchorPosition} + anchorPosition={shouldUseStyleUtilityForAnchorPosition ? styles.popoverButtonDropdownMenuOffset(windowWidth) : popoverAnchorPosition} shouldShowSelectedItemCheck={shouldShowSelectedItemCheck} anchorRef={nullCheckRef(dropdownAnchor)} withoutOverlay diff --git a/src/components/ButtonWithDropdownMenu/types.ts b/src/components/ButtonWithDropdownMenu/types.ts index 58689958fb53..59bfd74cd55d 100644 --- a/src/components/ButtonWithDropdownMenu/types.ts +++ b/src/components/ButtonWithDropdownMenu/types.ts @@ -96,6 +96,9 @@ type ButtonWithDropdownMenuProps = { /** Whether to use keyboard shortcuts for confirmation or not */ useKeyboardShortcuts?: boolean; + /** Determines if a style utility function should be used for calculating the PopoverMenu anchor position. */ + shouldUseStyleUtilityForAnchorPosition?: boolean; + /** Decides which index in menuItems should be selected */ defaultSelectedIndex?: number; diff --git a/src/components/Search/SearchPageHeader.tsx b/src/components/Search/SearchPageHeader.tsx index 714b388b7331..c04ae1fceb65 100644 --- a/src/components/Search/SearchPageHeader.tsx +++ b/src/components/Search/SearchPageHeader.tsx @@ -316,6 +316,7 @@ function SearchPageHeader({queryJSON, hash, onSelectDeleteOption, setOfflineModa customText={translate('workspace.common.selected', {selectedNumber: selectedTransactionsKeys.length})} options={headerButtonsOptions} isSplitButton={false} + shouldUseStyleUtilityForAnchorPosition /> ) : (