Skip to content
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

Bug fix: ButtonGroup with Tooltips #5123

Merged
merged 17 commits into from
Dec 17, 2024
Merged

Bug fix: ButtonGroup with Tooltips #5123

merged 17 commits into from
Dec 17, 2024

Conversation

langermank
Copy link
Contributor

@langermank langermank commented Oct 14, 2024

Closes #4129

Related:

Changelog

Made CSS a bit more specific

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Oct 14, 2024

🦋 Changeset detected

Latest commit: d30f6fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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

Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 14, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-5123 October 14, 2024 22:59 Inactive
Copy link
Contributor

github-actions bot commented Oct 14, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 103.18 KB (-0.06% 🔽)
packages/react/dist/browser.umd.js 103.6 KB (+0.08% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-5123 October 22, 2024 22:27 Inactive
@langermank langermank changed the title ButtonGroup WIP Bug fix: ButtonGroup with Tooltips Oct 22, 2024
@primer primer bot temporarily deployed to github-pages December 10, 2024 23:12 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-5123 December 10, 2024 23:12 Inactive
@jonrohan jonrohan force-pushed the button-group-shenanigans branch from f08156b to 8621b12 Compare December 11, 2024 02:56
Copy link
Contributor

@iansan5653 iansan5653 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was pointed here from #5452, and just wanted to make a small suggestion: instead of wrapping each item in a container, it might be easier and safer to just switch to using first-of-type and last-of-type selectors - something like &:is(button, a):last-of-type.

@jonrohan
Copy link
Member

@iansan5653 I attempted to do that here #5343 and that caused these bugs I think cause it's not always all button or all a
image

Copy link
Contributor

Uh oh! @jonrohan, the image you shared is missing helpful alt text. Check #5123 (comment).

Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.

Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.

🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.

@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/355518

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Dec 17, 2024
@primer-integration
Copy link

🟢 golden-jobs completed with status success.

Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@@ -83,6 +104,7 @@ const ButtonGroup = React.forwardRef<HTMLElement, ButtonGroupProps>(function But
forwardRef,
) {
const enabled = useFeatureFlag('primer_react_css_modules_ga')
const buttons = React.Children.map(children, (child, index) => <div key={index}>{child}</div>)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One alternative idea I had here was to check when the child is the last item, we could add a special classname to re-round the corners, thinking it might be more predictable than relying on direct children selectors. But this also works and I'm fine with it getting out like this.

@langermank langermank added this pull request to the merge queue Dec 17, 2024
Merged via the queue into main with commit becad7d Dec 17, 2024
42 checks passed
@langermank langermank deleted the button-group-shenanigans branch December 17, 2024 22:43
@primer primer bot mentioned this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using <Tooltip> within <ButtonGroup> affects styling
7 participants