Skip to content

Commit

Permalink
fix: transform Select arrow on open
Browse files Browse the repository at this point in the history
  • Loading branch information
wp-aberg committed Mar 18, 2024
1 parent 692f371 commit 4ff2c1c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/kit/src/select/SelectTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ const IconWrapper = styled("div", {
gridArea: "icon",
});

const AnimatedIcon = styled(Icon, {
transition: `transform ${theme.transitions.normal} ${theme.transitions.inOut}`,
"@reducedMotion": {
transition: "none",
},
'[aria-expanded="true"] &': {
transform: "rotate(180deg)",
},
});

type SelectTriggerVariants = WPDS.VariantProps<typeof StyledTrigger>;

type SelectTriggerProps = RadixAccordionTriggerProps &
Expand Down Expand Up @@ -124,9 +134,9 @@ export const SelectTrigger = React.forwardRef<
>
{children}
<IconWrapper isDisabled={disabled}>
<Icon label="">
<AnimatedIcon label="">
<ChevronDown />
</Icon>
</AnimatedIcon>
</IconWrapper>
</StyledTrigger>
<SubTextWrapper>
Expand Down

0 comments on commit 4ff2c1c

Please sign in to comment.