Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
fix(Select): change how we default the list startIconAs
Browse files Browse the repository at this point in the history
The `css` prop doesn't work in the default props, so we have to do it
elsewhere.
  • Loading branch information
justinanastos committed Mar 8, 2021
1 parent de95a8a commit b818ff5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export const Select: React.FC<Props> = ({
disabled = false,
feel,
labelPropsCallbackRef,
listAs = <List startIconAs={<div css={{ alignSelf: "baseline" }} />} />,
listAs = <List />,
margin = "auto",
matchTriggerWidth,
onBlur,
Expand Down Expand Up @@ -469,6 +469,17 @@ export const Select: React.FC<Props> = ({
listAs,
{
margin,
startIconAs: React.cloneElement(
listAs.props.startIconAs || <div />,
{
className: cx(
css`
align-self: baseline;
`,
listAs.props.startIconAs?.props?.className,
),
},
),
truncate,
...getMenuProps(undefined, { suppressRefError: true }),
...(id && { id: `${id}-menu` }),
Expand Down

0 comments on commit b818ff5

Please sign in to comment.