Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly dismissable default value #4524

Open
wants to merge 2 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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/lucky-parrots-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@nextui-org/popover": patch
"@nextui-org/modal": patch
---

Correctly dismissable default value
10 changes: 9 additions & 1 deletion packages/components/modal/src/use-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,17 @@ interface Props extends HTMLNextUIProps<"section"> {
* ```
*/
classNames?: SlotsToClasses<ModalSlots>;
/**
* Whether to close the overlay when the user interacts outside it.
* @default true
*/
isDismissable?: boolean;
}

export type UseModalProps = Props & OverlayTriggerProps & AriaModalOverlayProps & ModalVariantProps;
export type UseModalProps = Props &
OverlayTriggerProps &
Omit<AriaModalOverlayProps, "isDismissable"> &
ModalVariantProps;

export function useModal(originalProps: UseModalProps) {
const globalContext = useProviderContext();
Expand Down
9 changes: 8 additions & 1 deletion packages/components/popover/src/use-aria-popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ export interface Props {
* @default true
*/
shouldCloseOnScroll?: boolean;
/**
* Whether to close the overlay when the user interacts outside it.
* @default true
*/
isDismissable?: boolean;
}

export type ReactAriaPopoverProps = Props & Omit<AriaPopoverProps, "placement"> & AriaOverlayProps;
export type ReactAriaPopoverProps = Props &
Omit<AriaPopoverProps, "placement"> &
Omit<AriaOverlayProps, "isDismissable">;

/**
* Provides the behavior and accessibility implementation for a popover component.
Expand Down
Loading