From 2844d9a317ce4a958e0072e24d4bf09943d41776 Mon Sep 17 00:00:00 2001 From: winches <329487092@qq.com> Date: Thu, 9 Jan 2025 22:11:24 +0800 Subject: [PATCH 1/3] fix: correctly dismissable default value --- packages/components/modal/src/use-modal.ts | 10 +++++++++- packages/components/popover/src/use-aria-popover.ts | 9 ++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/components/modal/src/use-modal.ts b/packages/components/modal/src/use-modal.ts index 9e041ce54d..7de946e710 100644 --- a/packages/components/modal/src/use-modal.ts +++ b/packages/components/modal/src/use-modal.ts @@ -74,9 +74,17 @@ interface Props extends HTMLNextUIProps<"section"> { * ``` */ classNames?: SlotsToClasses; + /** + * 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 & + ModalVariantProps; export function useModal(originalProps: UseModalProps) { const globalContext = useProviderContext(); diff --git a/packages/components/popover/src/use-aria-popover.ts b/packages/components/popover/src/use-aria-popover.ts index 9eeacf1259..7d686a5136 100644 --- a/packages/components/popover/src/use-aria-popover.ts +++ b/packages/components/popover/src/use-aria-popover.ts @@ -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 & AriaOverlayProps; +export type ReactAriaPopoverProps = Props & + Omit & + Omit; /** * Provides the behavior and accessibility implementation for a popover component. From eea1e03113a8f83ec4372fee4472d5914a0bf597 Mon Sep 17 00:00:00 2001 From: winches <329487092@qq.com> Date: Thu, 9 Jan 2025 22:11:53 +0800 Subject: [PATCH 2/3] fix: correctly dismissable default value --- .changeset/lucky-parrots-compete.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/lucky-parrots-compete.md diff --git a/.changeset/lucky-parrots-compete.md b/.changeset/lucky-parrots-compete.md new file mode 100644 index 0000000000..7a54c5df9e --- /dev/null +++ b/.changeset/lucky-parrots-compete.md @@ -0,0 +1,6 @@ +--- +"@nextui-org/popover": patch +"@nextui-org/modal": patch +--- + +Correctly dismissable default value From 44258252769bfec00b87339b988f03887fe59421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=D3=84=D5=A1?= Date: Sat, 18 Jan 2025 21:03:23 +0800 Subject: [PATCH 3/3] chore(changeset): update package name --- .changeset/lucky-parrots-compete.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/lucky-parrots-compete.md b/.changeset/lucky-parrots-compete.md index 7a54c5df9e..524fd8cd2b 100644 --- a/.changeset/lucky-parrots-compete.md +++ b/.changeset/lucky-parrots-compete.md @@ -1,6 +1,6 @@ --- -"@nextui-org/popover": patch -"@nextui-org/modal": patch +"@heroui/popover": patch +"@heroui/modal": patch --- Correctly dismissable default value