Skip to content

fix button text not wrapping - #154

Merged
jivey merged 8 commits into
mainfrom
CORE-2480
Sep 30, 2026
Merged

jivey merged 8 commits into
mainfrom
CORE-2480

Conversation

@jivey

@jivey jivey commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

https://openstax.atlassian.net/browse/CORE-2918

This fixes an issue with the button text not wrapping when the button becomes longer than the width of the viewport, creating overflow. It should instead wrap to a new line (and not be limited by height.) I also customized the list of ladle viewport sizes to include 320, it will hopefully make it easier to test that minimum size to spot issues like this in the future.

Before:

Screenshot 2026-09-21 at 12 13 33

After:

Screenshot 2026-09-21 at 12 14 56

Text without spaces:

Screenshot 2026-09-21 at 12 34 21

This fixes an issue with the button text not wrapping when the button
becomes longer than the width of the viewport, creating overflow. It
should instead wrap to a new line (and not be limited by height.) I
also customized the list of ladle viewport sizes to include 320, it
will hopefully make it easier to test that minimum size to spot issues
like this in the future.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The story contains a critical TypeScript callback error and the input lacks an accessible name.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Low severity

Open (2)
What changed in this PR

This PR fixes long button labels overflowing narrow viewports and adds a 320px Ladle viewport for testing.

Changes:

  • Enables multiline button labels with flexible height.
  • Adds editable button text to the Primary story.
  • Adds viewport presets and bumps the package version to 1.23.10.
File Summary
src/​components/​Button.stories.tsx Adds interactive button text testing. Critical finding (2 votes): the Input callback uses an invalid native event shape. Nit (2 votes): the input lacks an accessible name.
src/​components/​Button.css Enables text wrapping and dynamic button height.
package.json Bumps the package version.
.ladle/​config.mjs Adds viewport width presets.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/Button.stories.tsx Outdated
Comment thread src/components/Button.stories.tsx Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jivey

jivey commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@RoyEJohnson What's the @types/dompurify deletion?

@RoyEJohnson

Copy link
Copy Markdown
Contributor

It was generating a warning that "@types/dompurify is a stub. It is not needed." Starting with version 3.2.0, it ships with TS definitions.

@jivey
jivey merged commit e797833 into main Sep 30, 2026
3 checks passed
@jivey
jivey deleted the CORE-2480 branch September 30, 2026 16:28

This branch was successfully deployed

1 active deployment
refs/heads/CORE-2480 — ed46d287 Deployed Sep 30, 2026 by github-actions[bot]
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.

3 participants