Skip to content

Commit

Permalink
fix: allow passing of className to Listbox Option component
Browse files Browse the repository at this point in the history
  • Loading branch information
joshenlim committed Sep 2, 2022
1 parent 0dfdcbf commit fe7b979
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Listbox/Listbox2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ interface OptionProps {
label: string
disabled?: boolean
children?: React.ReactNode
className?: string
addOnBefore?: ({ active, selected }: any) => React.ReactNode
}

Expand All @@ -289,6 +290,7 @@ function SelectOption({
label,
disabled = false,
children,
className = '',
addOnBefore,
}: OptionProps) {
const __styles = styleHandler('listbox')
Expand All @@ -301,11 +303,11 @@ function SelectOption({
return (
<DropdownMenuPrimitive.Item
key={id}
className={classNames(
className={`${classNames(
__styles.option,
active ? __styles.option_active : ' ',
disabled ? __styles.option_disabled : ' '
)}
)} ${className}`}
onSelect={() => (!disabled ? onChange(value) : {})}
>
<div className={__styles.option_inner}>
Expand Down

0 comments on commit fe7b979

Please sign in to comment.