fix(SW-1509): add support for default selected key
fixed padding per list item
This commit is contained in:
@@ -4,12 +4,20 @@ import styles from './select.module.css'
|
||||
import { MaterialIcon } from '../Icons/MaterialIcon'
|
||||
import { SelectItemProps } from './types'
|
||||
|
||||
export function SelectItem({ children, icon, isDisabled }: SelectItemProps) {
|
||||
export function SelectItem({
|
||||
children,
|
||||
icon,
|
||||
isDisabled,
|
||||
...props
|
||||
}: SelectItemProps) {
|
||||
const iconColor = isDisabled ? 'Icon/Interactive/Disabled' : 'Icon/Default'
|
||||
|
||||
return (
|
||||
<ListBoxItem
|
||||
className={styles.listBoxItem}
|
||||
textValue={children}
|
||||
isDisabled={isDisabled}
|
||||
{...props}
|
||||
>
|
||||
{({ isSelected }) => (
|
||||
<>
|
||||
@@ -17,7 +25,7 @@ export function SelectItem({ children, icon, isDisabled }: SelectItemProps) {
|
||||
<MaterialIcon
|
||||
icon={icon}
|
||||
size={24}
|
||||
color={isDisabled ? 'Icon/Interactive/Disabled' : 'Icon/Default'}
|
||||
color={iconColor}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user