Skip to content

Commit

Permalink
don't use pseudo-element for dropdown caret
Browse files Browse the repository at this point in the history
  • Loading branch information
macfarlandian committed Apr 21, 2021
1 parent 45fd78d commit ba3190e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions spotlight-client/src/UiLibrary/Dropdown/DropdownBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ const DropdownButton = styled(animated.button)<{
&:focus {
outline: none;
}
`;

&::after {
border-left: ${rem(4)} solid transparent;
border-right: ${rem(4)} solid transparent;
border-top: ${rem(4)} solid currentColor;
content: "";
height: 0;
margin-left: ${rem(16)};
width: 0;
}
const DropdownButtonCaret = styled.span`
border-left: ${rem(4)} solid transparent;
border-right: ${rem(4)} solid transparent;
border-top: ${rem(4)} solid currentColor;
content: "";
height: 0;
margin-left: ${rem(16)};
width: 0;
`;

const DropdownBase: React.FC<
Expand Down Expand Up @@ -155,6 +155,7 @@ const DropdownBase: React.FC<
onBlur={() => setButtonHover(false)}
>
{buttonContents || <span aria-hidden>{label}</span>}
<DropdownButtonCaret />
</DropdownButton>
{useFixedMenu ? (
<FixedMenu {...menuProps} />
Expand Down

0 comments on commit ba3190e

Please sign in to comment.