fix: correctly dismissable default value (#4524)

* fix: correctly dismissable default value

* fix: correctly dismissable default value

* chore(changeset): update package name

---------

Co-authored-by: աӄա <wingkwong.code@gmail.com>
This commit is contained in:
winches 2025-02-06 05:14:51 +08:00 committed by GitHub
parent 2573e8269b
commit 5e3054e318
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
"@heroui/popover": patch
"@heroui/modal": patch
---
Correctly dismissable default value

View File

@ -69,9 +69,17 @@ interface Props extends HTMLHeroUIProps<"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();

View File

@ -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.