Skip to content

feat: add disabled state to the create item option #1911

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

simotae14
Copy link
Contributor

What does it do?

Add a new disabled state, and style, to the Combobox Create item option

Why is it needed?

We want to show the combobox options and disable the combobox create item button in case the user has no permission to create an item.

How to test it?

In the storybook you can find a new Combobox Creatable disabled section to check the solution provided.

Related issue(s)/PR(s)

CS-1405

@simotae14 simotae14 added pr: feature This PR adds a new feature source: design-system relates to design-system package labels Apr 30, 2025
@simotae14 simotae14 requested a review from remidej April 30, 2025 09:43
@simotae14 simotae14 self-assigned this Apr 30, 2025
Copy link

changeset-bot bot commented Apr 30, 2025

🦋 Changeset detected

Latest commit: 2c39d3e

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

This PR includes changesets to release 3 packages
Name Type
@strapi/design-system Minor
@strapi/icons Minor
@strapi/ui-primitives Minor

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 Apr 30, 2025

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

Name Status Preview Comments Updated (UTC)
design-system ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2025 9:43am

@simotae14 simotae14 requested a review from markkaylor May 5, 2025 07:58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should include this story in the storybook docs page too

@@ -47,6 +47,7 @@ interface ComboboxProps
Omit<ComboboxPrimitive.TextInputProps, 'required' | 'disabled' | 'value' | 'onChange' | 'size'> {
clearLabel?: string;
creatable?: boolean | 'visible';
creatableDisabled?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screenshot 2025-05-05 at 11 11 25@2x

fyi the props table doesn't receive the type properly

Comment on lines +438 to +442
&&[data-disabled] {
color: ${({ theme }) => theme.colors.neutral600};
background: ${({ theme }) => theme.colors.neutral150};
cursor: not-allowed;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a small visual issue with the border radii
screenshot 2025-05-05 at 11 12 13@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: feature This PR adds a new feature source: design-system relates to design-system package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants