Skip to content

Conversation

@Bracciata
Copy link
Contributor

@Bracciata Bracciata commented Jan 22, 2026

Closes #2190 and https://github.com/dequelabs/walnut/issues/13150 ##1982

Updates buttons so they do not wrap unless overridden to wrap.

QA Steps:
Navigate to a page with a button
Shrink the width of the page until it is less than the width of the button
Verify the button doesn't wrap and instead overflows the page.

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2214.d15792l1n26ww3.amplifyapp.com

@Bracciata Bracciata marked this pull request as ready for review January 22, 2026 18:37
@Bracciata Bracciata requested review from a team as code owners January 22, 2026 18:37
Copilot AI review requested due to automatic review settings January 22, 2026 18:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents button contents from wrapping by default, addressing issue #2190. The change ensures buttons maintain their natural width to accommodate content without wrapping unless explicitly overridden.

Changes:

  • Added min-width: max-content CSS property to button styles to prevent text wrapping
  • Added e2e test to verify default no-wrap behavior and override capability

Reviewed changes

Copilot reviewed 2 out of 19 changed files in this pull request and generated 1 comment.

File Description
packages/styles/button.css Adds min-width CSS property to prevent button text wrapping
packages/react/src/components/Button/screenshots.e2e.tsx Adds test coverage for button wrapping behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shawnsharpDQ
Copy link

shawnsharpDQ commented Jan 22, 2026

@Bracciata I am seeing that there used to be a max-width of 6.25rem on the button. The change you have implemented is what we would like from design but I am not sure if this will have a cascading effect across our products. Anyway to confirm if this is a breaking change or not?

Here is the cauldron ticket referring to the change #1982

@Bracciata
Copy link
Contributor Author

Bracciata commented Jan 22, 2026

@Bracciata I am seeing that there used to be a max-width of 6.25rem on the button. The change you have implemented is what we would like from design but I am not sure if this will have a cascading effect across our products. Anyway to confirm if this is a breaking change or not?

There is a good chance it is a breaking change within some repo. Thoughts on doing min-width: min(max-content, 6.25rem)?

@shawnsharpDQ

Correction. Not a breaking change as there was previously a min width and this is a desired change. The minimum still fits all content.

shawnsharpDQ
shawnsharpDQ previously approved these changes Jan 22, 2026
Copy link

@shawnsharpDQ shawnsharpDQ left a comment

Choose a reason for hiding this comment

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

2 birds with 1 stone! Love it

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.

Bug: Cauldron button labels should not wrap

3 participants