fix(popover): isDismissable prop passed to aria popover hook (#2032)

This commit is contained in:
Junior Garcia 2023-11-24 09:46:51 -03:00 committed by GitHub
parent 436ba1cd84
commit 01aedcf09b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"@nextui-org/popover": patch
---
Fix #2025 isDismissable prop passed to the aria-popover hook.

View File

@ -47,6 +47,7 @@ export function useReactAriaPopover(
scrollRef,
shouldFlip,
boundaryElement,
isDismissable = true,
shouldCloseOnBlur = true,
placement: placementProp = "top",
containerPadding,
@ -63,7 +64,7 @@ export function useReactAriaPopover(
isOpen: state.isOpen,
onClose: state.close,
shouldCloseOnBlur,
isDismissable: true,
isDismissable,
isKeyboardDismissDisabled,
shouldCloseOnInteractOutside: shouldCloseOnInteractOutside
? shouldCloseOnInteractOutside

View File

@ -91,6 +91,7 @@ export function usePopover(originalProps: UsePopoverProps) {
shouldFlip = true,
containerPadding = 12,
shouldBlockScroll = false,
isDismissable = true,
shouldCloseOnBlur,
portalContainer,
placement: placementProp = "top",
@ -144,6 +145,7 @@ export function usePopover(originalProps: UsePopoverProps) {
placement: placementProp,
offset: offset,
scrollRef,
isDismissable,
shouldCloseOnBlur,
boundaryElement,
crossOffset,

View File

@ -454,6 +454,16 @@ export const DisableAnimation = {
},
};
export const NonDismissable = {
render: Template,
args: {
...defaultProps,
showArrow: true,
isDismissable: false,
},
};
export const WithoutScaleTrigger = {
render: Template,