Skip to content
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

Conversation

kuri-sun
Copy link
Member

@kuri-sun kuri-sun commented Mar 3, 2024

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 the isDisabled 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

Copy link

vercel bot commented Mar 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 3, 2024 0:05am

Copy link

changeset-bot bot commented Mar 3, 2024

🦋 Changeset detected

Latest commit: 6db752b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@nextui-org/dropdown Major
@nextui-org/react Patch

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

Copy link

vercel bot commented Mar 3, 2024

@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 {
Copy link
Member Author

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

@jrgarciadev jrgarciadev merged commit 9b27da5 into nextui-org:main Mar 3, 2024
7 of 8 checks passed
@kuri-sun kuri-sun deleted the fix/components/isdisabled-does-not-disable-dropdown branch March 3, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - isDisabled does not disable dropdown
2 participants