Skip to content

Commit

Permalink
chore: update floating ui platform method isRTL to always return false
Browse files Browse the repository at this point in the history
  • Loading branch information
geotrev committed Mar 1, 2024
1 parent ce407db commit 7c3f2af
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/dropdowns.next/src/elements/menu/MenuList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ import {
toFloatingPlacement,
toMenuPosition
} from './utils';
import { Placement, autoUpdate, flip, offset, size, useFloating } from '@floating-ui/react-dom';
import {
Placement,
autoUpdate,
platform,
flip,
offset,
size,
useFloating
} from '@floating-ui/react-dom';
import { IMenuListProps, PLACEMENT } from '../../types';
import { StyledFloatingMenu, StyledMenu } from '../../views';
import { createPortal } from 'react-dom';
Expand Down Expand Up @@ -58,6 +66,14 @@ export const MenuList = forwardRef<HTMLUListElement, IMenuListProps>(
update,
floatingStyles: { transform }
} = useFloating<HTMLElement>({
platform: {
...platform,
// Prevent floating UI from inferring RTL based on DOM computed style direction
// References:
// - https://github.com/floating-ui/floating-ui/issues/1530
// - https://github.com/floating-ui/floating-ui/blob/master/packages/core/src/computePosition.ts#L29
isRTL: () => false
},
elements: { reference: triggerRef?.current, floating: floatingRef?.current },
placement: floatingPlacement as Placement,
middleware: [
Expand Down

0 comments on commit 7c3f2af

Please sign in to comment.