Skip to content

Commit f29ad48

Browse files
authored
fix(DropdownMenu): use Bootstrap default offsets (react-bootstrap#5662)
1 parent 3963f72 commit f29ad48

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/DropdownMenu.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import warning from 'warning';
1111
import NavbarContext from './NavbarContext';
1212
import { useBootstrapPrefix } from './ThemeProvider';
1313
import useWrappedRefWithWarning from './useWrappedRefWithWarning';
14-
import usePopperMarginModifiers from './usePopperMarginModifiers';
1514
import {
1615
BsPrefixProps,
1716
BsPrefixRefForwardingComponent,
@@ -155,7 +154,6 @@ const DropdownMenu: BsPrefixRefForwardingComponent<
155154
) => {
156155
const isNavbar = useContext(NavbarContext);
157156
const prefix = useBootstrapPrefix(bsPrefix, 'dropdown-menu');
158-
const [popperRef, marginModifiers] = usePopperMarginModifiers();
159157

160158
const alignClasses: string[] = [];
161159
if (align) {
@@ -195,18 +193,13 @@ const DropdownMenu: BsPrefixRefForwardingComponent<
195193
show: showProps,
196194
alignEnd: alignRight,
197195
usePopper: !isNavbar && alignClasses.length === 0,
198-
popperConfig: {
199-
...popperConfig,
200-
modifiers: marginModifiers.concat(popperConfig?.modifiers || []),
201-
},
196+
offset: [0, 2],
197+
popperConfig,
202198
}) as UseDropdownMenuValueHack;
203199

204200
menuProps.ref = useMergedRefs(
205-
popperRef,
206-
useMergedRefs(
207-
useWrappedRefWithWarning(ref, 'DropdownMenu'),
208-
menuProps.ref,
209-
),
201+
useWrappedRefWithWarning(ref, 'DropdownMenu'),
202+
menuProps.ref,
210203
);
211204

212205
if (!hasShown && !renderOnMount) return null;

0 commit comments

Comments
 (0)