Skip to content

Commit

Permalink
fix: Dropdown misalign on scroll
Browse files Browse the repository at this point in the history
Apparently this is a breaking change when Popper evolved into FloatingUI, you need to add autoUpdate manually now

REF: https://floating-ui.com/docs/migration#updating-the-position-automatically

Closes #15
  • Loading branch information
null2264 committed Sep 18, 2023
1 parent 063a3bb commit 8a4e28e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/soapbox/components/dropdown-menu/dropdown-menu.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { offset, Placement, useFloating, flip, arrow, shift } from '@floating-ui/react';
import { offset, Placement, useFloating, flip, arrow, shift, autoUpdate } from '@floating-ui/react';
import clsx from 'clsx';
import { supportsPassiveEvents } from 'detect-passive-events';
import React, { useEffect, useMemo, useRef, useState } from 'react';
Expand Down Expand Up @@ -70,6 +70,7 @@ const DropdownMenu = (props: IDropdownMenu) => {
element: arrowRef,
}),
],
whileElementsMounted: !isOnMobile ? autoUpdate : undefined,
});

const handleClick: React.EventHandler<
Expand Down

0 comments on commit 8a4e28e

Please sign in to comment.