Skip to content

Commit

Permalink
fix: Button resizing in horizontal filter bar (#22365)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Dec 8, 2022
1 parent de4f509 commit 3a442e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions superset-frontend/src/components/Badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export interface BadgeProps extends AntdBadgeProps {
const Badge = styled(
(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
{ textColor, ...props }: BadgeProps,
) => <AntdBadge {...props} />,
{ textColor, color, text, ...props }: BadgeProps,
) => <AntdBadge text={text} color={text ? color : undefined} {...props} />,
)`
& > sup {
padding: 0 ${({ theme }) => theme.gridUnit * 2}px;
Expand Down
10 changes: 7 additions & 3 deletions superset-frontend/src/components/DropdownContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,14 @@ const DropdownContainer = forwardRef(
{dropdownTriggerText}
<Badge
count={dropdownTriggerCount ?? overflowingCount}
color={
(dropdownTriggerCount ?? overflowingCount) > 0
? theme.colors.primary.base
: theme.colors.grayscale.light1
}
showZero
css={css`
margin-left: ${dropdownTriggerCount ?? overflowingCount
? `${theme.gridUnit * 2}px`
: '0'};
margin-left: ${theme.gridUnit * 2}px;
`}
/>
<Icons.DownOutlined
Expand Down

0 comments on commit 3a442e0

Please sign in to comment.