-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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(components): isdisabled does not disable dropdown #2435
fix(components): isdisabled does not disable dropdown #2435
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 6db752b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@kuri-sun is attempting to deploy a commit to the NextUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
@@ -119,15 +119,15 @@ 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. | |||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | |||
const {onKeyDown, onPress, onPressStart, ...otherMenuTriggerProps} = menuTriggerProps; | |||
|
|||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is important here to use props.isDisabled
so that the PopoverTrigger component can respect another isDisabled
gets passed by the user. (Otherwise, the unit test is going to fail.)
Closes #2276
📝 Description
Based on the docs, adding an isDisabled prop and setting it to true does not disable a dropdown
⛳️ Current behavior (updates)
The
isDisabled
prop does not work, because the Dropdown component does not pass theisDisabled
prop to the PopoverTrigger component.🚀 New behavior
It disables the trigger when
isDisabled
prop gets passed.Screen.Recording.2024-03-03.at.8.21.55.AM.mov
💣 Is this a breaking change (Yes/No):
No.
📝 Additional Information
N/A