Skip to content

Commit 03d2018

Browse files
committed
chore: update floating ui platform method isRTL to always return false
1 parent ce407db commit 03d2018

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

packages/dropdowns.next/src/elements/menu/MenuList.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ import {
1515
toFloatingPlacement,
1616
toMenuPosition
1717
} from './utils';
18-
import { Placement, autoUpdate, flip, offset, size, useFloating } from '@floating-ui/react-dom';
18+
import {
19+
Placement,
20+
autoUpdate,
21+
platform,
22+
flip,
23+
offset,
24+
size,
25+
useFloating
26+
} from '@floating-ui/react-dom';
1927
import { IMenuListProps, PLACEMENT } from '../../types';
2028
import { StyledFloatingMenu, StyledMenu } from '../../views';
2129
import { createPortal } from 'react-dom';
@@ -58,6 +66,14 @@ export const MenuList = forwardRef<HTMLUListElement, IMenuListProps>(
5866
update,
5967
floatingStyles: { transform }
6068
} = useFloating<HTMLElement>({
69+
platform: {
70+
...platform,
71+
// Defers RTL determination to Garden at all times.
72+
// References:
73+
// - https://github.com/floating-ui/floating-ui/issues/1530
74+
// - https://github.com/floating-ui/floating-ui/blob/master/packages/dom/src/platform/isRTL.ts#L3
75+
isRTL: () => false
76+
},
6177
elements: { reference: triggerRef?.current, floating: floatingRef?.current },
6278
placement: floatingPlacement as Placement,
6379
middleware: [

0 commit comments

Comments
 (0)