Don't show <img> when there is no icon
This commit is contained in:
parent
ab6897c205
commit
ab702edb4b
1 changed files with 2 additions and 4 deletions
|
|
@ -100,14 +100,12 @@ const Select = React.forwardRef<HTMLButtonElement, Props>(function select(
|
||||||
placeholder={props.placeholder}
|
placeholder={props.placeholder}
|
||||||
ref={forwardedRef}
|
ref={forwardedRef}
|
||||||
>
|
>
|
||||||
{props.icon ? <img alt={props.icon.alt} src={props.icon.src} /> : ''}
|
{props.icon?.src && <img alt={props.icon.alt} src={props.icon.src} />}
|
||||||
<RadixSelect.Value placeholder={props.trigger?.placeholder} />
|
<RadixSelect.Value placeholder={props.trigger?.placeholder} />
|
||||||
{!props.disabled ? (
|
{!props.disabled && (
|
||||||
<RadixSelect.Icon className={styles.icon}>
|
<RadixSelect.Icon className={styles.icon}>
|
||||||
<ChevronIcon />
|
<ChevronIcon />
|
||||||
</RadixSelect.Icon>
|
</RadixSelect.Icon>
|
||||||
) : (
|
|
||||||
''
|
|
||||||
)}
|
)}
|
||||||
</RadixSelect.Trigger>
|
</RadixSelect.Trigger>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue