Skip to content

Commit

Permalink
fix: can now disable Listbox
Browse files Browse the repository at this point in the history
  • Loading branch information
MildTomato committed Jul 20, 2022
1 parent 6f4a00d commit fd2309b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Listbox/Listbox2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function Listbox({
size={size}
>
<DropdownMenuPrimitive.Root>
<DropdownMenuPrimitive.Trigger asChild>
<DropdownMenuPrimitive.Trigger asChild disabled={disabled}>
<button
ref={triggerRef}
className={selectClasses.join(' ')}
Expand Down
14 changes: 14 additions & 0 deletions src/components/Listbox/SelectStyled.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,20 @@ export const Default = (args: any) => (
</Listbox>
)

export const ListBoxDisabled = (args: any) => (
<Listbox label="Default listbox" disabled>
<Listbox.Option label="Option 1" value="option-1">
Option 1
</Listbox.Option>
<Listbox.Option label="Option 2" value="option-2">
Option 2
</Listbox.Option>
<Listbox.Option disabled label="Option 3" value="option-3">
Option 3
</Listbox.Option>
</Listbox>
)

export const WithDisabled = (args: any) => (
<Listbox label="Default listbox">
<Listbox.Option label="Option 1" value="option-1">
Expand Down

0 comments on commit fd2309b

Please sign in to comment.