Skip to content

Commit 9d8543f

Browse files
committed
fix styles in web
1 parent 8765de9 commit 9d8543f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • src/components/ButtonWithDropdownMenu

src/components/ButtonWithDropdownMenu/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import mergeRefs from '@libs/mergeRefs';
1515
import CONST from '@src/CONST';
1616
import type {AnchorPosition} from '@src/styles';
1717
import type {ButtonWithDropdownMenuProps} from './types';
18+
import useResponsiveLayout from '@hooks/useResponsiveLayout';
1819

1920
function ButtonWithDropdownMenu<IValueType>({
2021
success = true,
@@ -60,6 +61,7 @@ function ButtonWithDropdownMenu<IValueType>({
6061
const [popoverAnchorPosition, setPopoverAnchorPosition] = useState<AnchorPosition | null>(defaultPopoverAnchorPosition);
6162
const {windowWidth, windowHeight} = useWindowDimensions();
6263
const dropdownAnchor = useRef<View | null>(null);
64+
const {shouldUseNarrowLayout} = useResponsiveLayout();
6365
// eslint-disable-next-line react-compiler/react-compiler
6466
const dropdownButtonRef = isSplitButton ? buttonRef : mergeRefs(buttonRef, dropdownAnchor);
6567
const selectedItem = options.at(selectedItemIndex) ?? options.at(0);
@@ -229,7 +231,7 @@ function ButtonWithDropdownMenu<IValueType>({
229231
anchorRef={nullCheckRef(dropdownAnchor)}
230232
withoutOverlay
231233
shouldUseScrollView
232-
scrollContainerStyle={styles.pv4}
234+
scrollContainerStyle={shouldUseNarrowLayout ? styles.pv4 : undefined}
233235
shouldUseModalPaddingStyle={false}
234236
anchorAlignment={anchorAlignment}
235237
headerText={menuHeaderText}

0 commit comments

Comments
 (0)