Left-align boost/quote menu to prevent shift based on descriptions (#36220)

This commit is contained in:
diondiondion 2025-09-22 13:54:06 +02:00 committed by GitHub
parent 6689040fc6
commit 66afc13b7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -333,6 +333,7 @@ interface DropdownProps<Item extends object | null = MenuItem> {
disabled?: boolean; disabled?: boolean;
scrollable?: boolean; scrollable?: boolean;
placement?: Placement; placement?: Placement;
offset?: OffsetValue;
/** /**
* Prevent the `ScrollableList` with this scrollKey * Prevent the `ScrollableList` with this scrollKey
* from being scrolled while the dropdown is open * from being scrolled while the dropdown is open
@ -348,7 +349,6 @@ interface DropdownProps<Item extends object | null = MenuItem> {
onItemClick?: ItemClickFn<Item>; onItemClick?: ItemClickFn<Item>;
} }
const offset = [5, 5] as OffsetValue;
const popperConfig = { strategy: 'fixed' } as UsePopperOptions; const popperConfig = { strategy: 'fixed' } as UsePopperOptions;
export const Dropdown = <Item extends object | null = MenuItem>({ export const Dropdown = <Item extends object | null = MenuItem>({
@ -361,6 +361,7 @@ export const Dropdown = <Item extends object | null = MenuItem>({
disabled, disabled,
scrollable, scrollable,
placement = 'bottom', placement = 'bottom',
offset = [5, 5],
status, status,
forceDropdown = false, forceDropdown = false,
renderItem, renderItem,

View File

@ -134,6 +134,8 @@ export const StatusBoostButton: FC<ReblogButtonProps> = ({
return ( return (
<Dropdown <Dropdown
placement='bottom-start'
offset={[-19, 5]} // This aligns button icon with menu icons
items={items} items={items}
renderItem={renderMenuItem} renderItem={renderMenuItem}
onOpen={handleDropdownOpen} onOpen={handleDropdownOpen}