Skip to content

Conversation

@rise-erpelding
Copy link
Collaborator

@rise-erpelding rise-erpelding commented Nov 12, 2025

Description

Fixes an issue with tooltip text overflow: long, unbroken words were not wrapping and overflowed the container. See screenshots.

Motivation and context

We have overflow-wrap: break-word; on #tooltip, but need inline-size: 100% on the label to force it to wrap properly in cases of longer text without spaces.

#5504 previously updated the CSS to remove the deprecated word-break: break-word in favor of overflow-wrap: break-word. @5t3ph explains and fixes the issue that this causes in CSS via adobe/spectrum-css#4044. This PR carries that fix over to be applied in SWC.

The fix in adobe/spectrum-css#4044 does not require modifications for icons because it addresses the S2 version of tooltip, where icon variants have been removed. Therefore, additional modifications were made here to accommodate the tooltip variants that include icons.

Related issue(s)

  • fixes SWC-313

Screenshots

Before:
image
image
image

After:
image
image
image


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Check regular tooltip wrapping (no icon)

    1. Go to 1st gen Storybook/Docs site and navigate to a tooltip with no icon
    2. Using Storybook controls or the browser inspector, change the tooltip label text to a single, long word (e.g., "supercalifragilisticexpialidocious" but you can use any long string)
    3. Confirm that the tooltip text wraps instead of overflowing the container
  • Check tooltip wrapping with icon

    1. Go to Storybook/Docs site and navigate to a tooltip with no icon
    2. Using Storybook controls or the browser inspector, change the tooltip label text to a single, long word
    3. Confirm that the tooltip text wraps instead of overflowing the container
    4. Confirm that tooltip spacing remains the same as with a short word or a longer, multi-word string

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

@rise-erpelding rise-erpelding added Status: WIP PR is a work in progress or draft do-not-merge NO MERGE-Y! labels Nov 12, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 12, 2025

🦋 Changeset detected

Latest commit: ea779aa

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

This PR includes changesets to release 78 packages
Name Type
@spectrum-web-components/tooltip Patch
@spectrum-web-components/picker Patch
@spectrum-web-components/bundle Patch
@spectrum-web-components/truncated Patch
@spectrum-web-components/action-menu Patch
@spectrum-web-components/breadcrumbs Patch
@spectrum-web-components/accordion Patch
@spectrum-web-components/action-bar Patch
@spectrum-web-components/action-button Patch
@spectrum-web-components/action-group Patch
@spectrum-web-components/alert-banner Patch
@spectrum-web-components/alert-dialog Patch
@spectrum-web-components/asset Patch
@spectrum-web-components/avatar Patch
@spectrum-web-components/badge Patch
@spectrum-web-components/button-group Patch
@spectrum-web-components/button Patch
@spectrum-web-components/card Patch
@spectrum-web-components/checkbox Patch
@spectrum-web-components/clear-button Patch
@spectrum-web-components/close-button Patch
@spectrum-web-components/coachmark Patch
@spectrum-web-components/color-area Patch
@spectrum-web-components/color-field Patch
@spectrum-web-components/color-handle Patch
@spectrum-web-components/color-loupe Patch
@spectrum-web-components/color-slider Patch
@spectrum-web-components/color-wheel Patch
@spectrum-web-components/combobox Patch
@spectrum-web-components/contextual-help Patch
@spectrum-web-components/dialog Patch
@spectrum-web-components/divider Patch
@spectrum-web-components/dropzone Patch
@spectrum-web-components/field-group Patch
@spectrum-web-components/field-label Patch
@spectrum-web-components/help-text Patch
@spectrum-web-components/icon Patch
@spectrum-web-components/icons-ui Patch
@spectrum-web-components/icons-workflow Patch
@spectrum-web-components/icons Patch
@spectrum-web-components/iconset Patch
@spectrum-web-components/illustrated-message Patch
@spectrum-web-components/infield-button Patch
@spectrum-web-components/link Patch
@spectrum-web-components/menu Patch
@spectrum-web-components/meter Patch
@spectrum-web-components/modal Patch
@spectrum-web-components/number-field Patch
@spectrum-web-components/overlay Patch
@spectrum-web-components/picker-button Patch
@spectrum-web-components/popover Patch
@spectrum-web-components/progress-bar Patch
@spectrum-web-components/progress-circle Patch
@spectrum-web-components/radio Patch
@spectrum-web-components/search Patch
@spectrum-web-components/sidenav Patch
@spectrum-web-components/slider Patch
@spectrum-web-components/split-view Patch
@spectrum-web-components/status-light Patch
@spectrum-web-components/swatch Patch
@spectrum-web-components/switch Patch
@spectrum-web-components/table Patch
@spectrum-web-components/tabs Patch
@spectrum-web-components/tags Patch
@spectrum-web-components/textfield Patch
@spectrum-web-components/thumbnail Patch
@spectrum-web-components/toast Patch
@spectrum-web-components/top-nav Patch
@spectrum-web-components/tray Patch
@spectrum-web-components/underlay Patch
@spectrum-web-components/base Patch
@spectrum-web-components/grid Patch
@spectrum-web-components/opacity-checkerboard Patch
@spectrum-web-components/reactive-controllers Patch
@spectrum-web-components/shared Patch
@spectrum-web-components/styles Patch
@spectrum-web-components/theme Patch
@spectrum-web-components/eslint-plugin 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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 12, 2025

📚 Branch Preview

🔍 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-5878

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@rise-erpelding rise-erpelding self-assigned this Nov 13, 2025
@rise-erpelding rise-erpelding force-pushed the swc-1331--wrap-tooltip-text branch from 45aefe2 to 043cece Compare November 13, 2025 19:24
@rise-erpelding rise-erpelding marked this pull request as ready for review November 13, 2025 19:52
@rise-erpelding rise-erpelding requested a review from a team as a code owner November 13, 2025 19:52
@rise-erpelding rise-erpelding added bug Something isn't working Component: Tooltip Spectrum CSS Status: Ready for review PR ready for review or re-review. SEV 3 Issue that cause noticeable errors/minor usability problems which cause confusion or degrade UX and removed Status: WIP PR is a work in progress or draft do-not-merge NO MERGE-Y! labels Nov 13, 2025
@rise-erpelding rise-erpelding force-pushed the swc-1331--wrap-tooltip-text branch from 043cece to b69aeb5 Compare November 13, 2025 19:59
@rise-erpelding rise-erpelding force-pushed the swc-1331--wrap-tooltip-text branch from b69aeb5 to ea779aa Compare November 14, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Component: Tooltip SEV 3 Issue that cause noticeable errors/minor usability problems which cause confusion or degrade UX Spectrum CSS Status: Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants