Repository navigation
Conversation
The press animation sets `transform: translateY(1px)` on every child of an IconButton but a `role='status'` one. The badge wrapper has no role, so on press that transform replaced the badge's own `translate(30%, -30%)` and the badge jumped toward the button's center. Positioning it with the `translate` property lets both apply: the badge keeps its corner and moves 1px with the icon.
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: b2e71b7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Folded into #42974. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #43066 +/- ##
===========================================
- Coverage 71.99% 71.97% -0.02%
===========================================
Files 5274 5274
Lines 224972 224972
Branches 41655 41804 +149
===========================================
- Hits 161966 161934 -32
- Misses 57792 57825 +33
+ Partials 5214 5213 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
Pressing an
IconButtonthat has abadgemade the badge jump from the button's corner toward its center, then back on release.The press animation (
click-animationininteractivity.scss) setstransform: translateY(1px)on every child of the button but arole='status'one. The badge wrapper (.rcx-button__badge) has no role, so on:activethat rule, being more specific, replaced the badge's owntransform: translate(30%, -30%).The badge is now placed with the
translateproperty, which composes withtransforminstead of being replaced by it: the badge keeps its corner and moves 1px with the icon, like the rest of the button's content.Measured in Chromium with a 16px badge:
Issue(s)
https://rocketchat.atlassian.net/browse/ARCH-2590
Steps to test or reproduce
IconButtonwith a badge (e.g. the room header's threads or discussions action with unread items, or theIconButtonbadge stories in Storybook).Further comments
Shipped in
@rocket.chat/fuselage0.96.0. Found while working on #42974, whosebadgePosition='bottom-end'will need the sametranslateonce this lands.