-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
buttonbar: support dropdowns #91886
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
buttonbar: support dropdowns #91886
Conversation
53a2884
to
344cc00
Compare
@@ -269,7 +269,7 @@ function ResolveActions({ | |||
itemsHidden={shouldDisplayCta} | |||
items={items} | |||
trigger={(triggerProps, isOpen) => ( | |||
<DropdownTrigger |
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.
This is now properly managed by ButtonBar
/* Middle buttons only need one border so we don't get a double line */ | ||
&:first-child + *:not(:last-child) { | ||
margin-left: -1px; | ||
} |
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.
The focus state seems to be cut-off, I think that’s because of the negative margin-left
:
FYI, I did something similar for segmentedControl
and PageFilterBar
but with a different approach, where we set transform: translateX
with -1px
for each item:
sentry/static/app/components/core/segmentedControl/index.chonk.tsx
Lines 10 to 19 in ab91c44
const getChildTransforms = (count: number) => { | |
return Array.from( | |
{length: count}, | |
(_, index) => css` | |
label:nth-of-type(${index + 1}) { | |
transform: translateX(-${index}px); | |
} | |
` | |
); | |
}; |
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.
Uf, good catch. I don't think that fixes it, but I do see that segmentedcontrol uses z-index with a positive value for the active element. I've reused that trick, changed to translate and it looks like it does the job
CleanShot.2025-05-20.at.09.32.28.mp4
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.
nice 🙌
PR reverted: 450d59c |
This reverts commit 1764d6d. Co-authored-by: scttcper <1400464+scttcper@users.noreply.github.com>
reverting as this messed up zindex of dropdowns inside button bars more https://sentry.slack.com/archives/C04KZQBNQ2U/p1747766755547099 |
I noticed noticed this while working on the issues dropdown. The rules we have do not account for the wrapper that is created by out dropdownmenu Before  After 
This reverts commit 1764d6d. Co-authored-by: scttcper <1400464+scttcper@users.noreply.github.com>
I noticed noticed this while working on the issues dropdown. The rules we have do not account for the wrapper that is created by out dropdownmenu
Before

After
