Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/silly-hotels-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/dropdown": patch
"@nextui-org/popover": patch
Comment thread
jijiseong marked this conversation as resolved.
Outdated
---

Remove conversion logic in useOverlay that was transforming Placement type to PlacementAxis type.
Comment thread
jijiseong marked this conversation as resolved.
Outdated
20 changes: 2 additions & 18 deletions packages/components/dropdown/src/use-dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import {useMenuTrigger} from "@react-aria/menu";
import {dropdown} from "@nextui-org/theme";
import {clsx} from "@nextui-org/shared-utils";
import {ReactRef, mergeRefs} from "@nextui-org/react-utils";
import {ariaShouldCloseOnInteractOutside, toReactAriaPlacement} from "@nextui-org/aria-utils";
import {ariaShouldCloseOnInteractOutside} from "@nextui-org/aria-utils";
import {useMemo, useRef} from "react";
import {mergeProps} from "@react-aria/utils";
import {MenuProps} from "@nextui-org/menu";
import {CollectionElement} from "@react-types/shared";
import {useOverlayPosition} from "@react-aria/overlays";

interface Props extends HTMLNextUIProps<"div"> {
/**
Expand Down Expand Up @@ -99,10 +98,6 @@ export function useDropdown(props: UseDropdownProps): UseDropdownReturn {
disableAnimation = globalContext?.disableAnimation ?? false,
onClose,
className,
containerPadding = 12,
offset = 7,
crossOffset = 0,
shouldFlip = true,
...otherProps
} = props;

Expand Down Expand Up @@ -139,17 +134,6 @@ export function useDropdown(props: UseDropdownProps): UseDropdownReturn {
[className],
);

const {placement} = useOverlayPosition({
isOpen: state.isOpen,
targetRef: triggerRef,
overlayRef: popoverRef,
placement: toReactAriaPlacement(placementProp),
offset,
crossOffset,
shouldFlip,
containerPadding,
});

const onMenuAction = (menuCloseOnSelect?: boolean) => {
if (menuCloseOnSelect !== undefined && !menuCloseOnSelect) {
return;
Expand All @@ -164,7 +148,7 @@ export function useDropdown(props: UseDropdownProps): UseDropdownReturn {

return {
state,
placement: placement || DEFAULT_PLACEMENT,
placement: placementProp,
ref: popoverRef,
disableAnimation,
shouldBlockScroll,
Expand Down
1 change: 0 additions & 1 deletion packages/components/popover/src/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export interface PopoverProps extends UsePopoverProps {
const Popover = forwardRef<"div", PopoverProps>((props, ref) => {
const {children, ...otherProps} = props;
const context = usePopover({...otherProps, ref});

Comment thread
jijiseong marked this conversation as resolved.
const [trigger, content] = Children.toArray(children);

const overlay = <Overlay portalContainer={context.portalContainer}>{content}</Overlay>;
Expand Down