Skip to content

🐛 fix: resolve ButtonGroup first item missing left border#517

Merged
futjesus merged 1 commit intomainfrom
fix/button-group-first-item-border
Feb 12, 2026
Merged

🐛 fix: resolve ButtonGroup first item missing left border#517
futjesus merged 1 commit intomainfrom
fix/button-group-first-item-border

Conversation

@futjesus
Copy link
Member

Summary

  • The animated pill <motion.div> was rendered as the first child inside the radiogroup container, causing Tailwind's first: / last: pseudo-selectors to target the pill instead of the first button
  • Replaced first:border-l, first:rounded-l-lg, last:border-r, last:rounded-r-lg CSS pseudo-selectors with explicit isFirst / isLast CVA variants computed from the item index
  • Added isFirst and isLast boolean props to ButtonGroupItem

Test plan

  • npm run check:types — no type errors
  • npm run lint — no lint errors
  • npm run test — all 394 tests pass
  • Storybook → ButtonGroup → verify left border is visible on the first item (both with and without a default selected value)

The animated pill <motion.div> was rendered as the first child inside the
radiogroup container, causing Tailwind's first:/last: pseudo-selectors to
target the pill instead of the first button. Replace CSS pseudo-selectors
with explicit isFirst/isLast CVA variants computed from the item index.
@futjesus futjesus changed the title Fix ButtonGroup first item missing left border 🐛 fix: resolve ButtonGroup first item missing left border Feb 12, 2026
@futjesus futjesus merged commit b344d65 into main Feb 12, 2026
1 check passed
@futjesus futjesus deleted the fix/button-group-first-item-border branch February 12, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant