Refactor dropdown (#1561)
This commit is contained in:
@ -22,6 +22,7 @@ type OwnProps = {
|
||||
};
|
||||
dropdownHotkeyScope?: HotkeyScope;
|
||||
dropdownPlacement?: Placement;
|
||||
onDropdownToggle?: (isDropdownOpen: boolean) => void;
|
||||
};
|
||||
|
||||
export function DropdownButton({
|
||||
@ -31,12 +32,14 @@ export function DropdownButton({
|
||||
hotkey,
|
||||
dropdownHotkeyScope,
|
||||
dropdownPlacement = 'bottom-end',
|
||||
onDropdownToggle,
|
||||
}: OwnProps) {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const { isDropdownButtonOpen, toggleDropdownButton, closeDropdownButton } =
|
||||
useDropdownButton({
|
||||
key: dropdownKey,
|
||||
onDropdownToggle,
|
||||
});
|
||||
|
||||
const { refs, floatingStyles } = useFloating({
|
||||
|
||||
Reference in New Issue
Block a user