-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Button resizing in horizontal filter bar #22365
fix: Button resizing in horizontal filter bar #22365
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22365 +/- ##
=======================================
Coverage 66.86% 66.86%
=======================================
Files 1847 1847
Lines 70562 70562
Branches 7741 7742 +1
=======================================
Hits 47179 47179
Misses 21382 21382
Partials 2001 2001
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great!
Can't we add a resize listener to the button and have the DropdownContainer recalculate its width? |
Thanks @michael-s-molina! Colorful badge was added as a visual cue to explicitly show that that some filters are currently applied and "0" count could be super confusing (we will use similar pattern in cross-filtering). If there is no better way to fix it (or if Kamil's suggestion won't work) we could add "disabled" 0 state of the badge with tool tip that no filters are currently applied (for now/until we find a better solution). The increased width and empty space does not look good unfortunately :( |
9802754
to
072929b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 3a442e0)
SUMMARY
Previously, the
DropdownContainer
only showed the badge count when the value was greater than zero. When the badge count was updated, the button would change its width to incorporate the badge count. That behavior could really impact user experience because the position of the button can totally change if that needed extra space ends up pushing another element to the popover. To resolve that, this PR always displays the badge count even if the value is zero.@kasiazjc Another possible solution would be to have more spacing between the button elements when there's no badge and less spacing when there's a badge. The important part would be to keep a constant button width. Let me know if you prefer that approach.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2022-12-07.at.4.52.58.PM.mov
TESTING INSTRUCTIONS
Check the video for instructions.
ADDITIONAL INFORMATION