fix(components): isdisabled does not disable dropdown (#2435)

This commit is contained in:
HaRuki 2024-03-04 05:30:27 +09:00 committed by GitHub
parent 5528ccd042
commit 9b27da544e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"@nextui-org/dropdown": major
---
Fixed the bug: isDisabled does not disable dropdown

View File

@ -119,7 +119,7 @@ export function useDropdown(props: UseDropdownProps) {
});
const getMenuTriggerProps: PropGetter = (
props = {},
originalProps = {},
_ref: Ref<any> | null | undefined = null,
) => {
// These props are not needed for the menu trigger since it is handled by the popover trigger.
@ -127,7 +127,7 @@ export function useDropdown(props: UseDropdownProps) {
const {onKeyDown, onPress, onPressStart, ...otherMenuTriggerProps} = menuTriggerProps;
return {
...mergeProps(otherMenuTriggerProps, props),
...mergeProps(otherMenuTriggerProps, {isDisabled: props.isDisabled, originalProps}),
ref: mergeRefs(_ref, triggerRef),
};
};