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

Add truncation prop to Button #4527

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Add truncation prop to Button #4527

wants to merge 5 commits into from

Conversation

langermank
Copy link
Contributor

@langermank langermank commented Apr 22, 2024

This has been an ongoing issue with the Button component across all frameworks. Previously, we had hoped to introduce this change that allows button labels to wrap by default if the label string is too long. However, after testing this behind a feature flag for a bit we continued to find random issues across dotcom as the change can lead to unpredictable layout regressions.

In Rails, to unblock a few open accessibility issues I decided to introduce the change with a param. This is a boolean, but I could refactor it to be closer to the prop I'm proposing here in React.

The only way to make this change the default is with a major release, and even then we would need to babysit it and individually fix each area where layout breaks. I don't think this is realistic, and feel like introducing it as a prop should be sufficient for unblocking teams and mitigating accessibility issues.

Closes https://github.com/github/primer/issues/3123

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

@langermank langermank requested a review from a team as a code owner April 22, 2024 23:12
Copy link

changeset-bot bot commented Apr 22, 2024

🦋 Changeset detected

Latest commit: e12f4e0

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

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

github-actions bot commented Apr 22, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 88.08 KB (+0.06% 🔺)
packages/react/dist/browser.umd.js 88.49 KB (+0.15% 🔺)

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.

None yet

1 participant