Skip to content

Commit

Permalink
Fix: [DS-394] Badges are not static inside ListBoxItem & Tag (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicky-comeau authored Oct 11, 2024
2 parents ccdffd9 + c603aff commit cc983eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/gold-otters-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hopper-ui/components": patch
---

Badge used to change appearance based on the states of its parent, but now Badge will remain the same when its parent's state changes.
5 changes: 1 addition & 4 deletions packages/components/src/ListBox/src/ListBoxItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,7 @@ function ListBoxItemInner(props: ListBoxItemInnerProps) {
}],
[BadgeContext, {
className: styles["hop-ListBoxItem__badge"],
isDisabled: isDisabled,
isHovered: isHovered,
isPressed: isPressed,
isSelected: isSelected
isDisabled: isDisabled
}],
[AvatarContext, {
className: styles["hop-ListBoxItem__avatar"],
Expand Down
7 changes: 2 additions & 5 deletions packages/components/src/tag/src/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function Tag(props: TagProps, ref: ForwardedRef<HTMLDivElement>) {
data-loading={isLoading || undefined}
>
{tagProps => {
const { allowsRemoving, isDisabled, isSelected, isPressed, isHovered } = tagProps;
const { allowsRemoving, isDisabled, isSelected } = tagProps;

return (
<>
Expand All @@ -171,10 +171,7 @@ function Tag(props: TagProps, ref: ForwardedRef<HTMLDivElement>) {
badgeVariant
);
},
isDisabled: isDisabled,
isHovered: isHovered,
isPressed: isPressed,
isSelected: isSelected
isDisabled: isDisabled
}],
[AvatarContext, {
className: styles["hop-Tag__avatar"],
Expand Down

0 comments on commit cc983eb

Please sign in to comment.