Repository navigation
Conversation
🤖 PR meta 🤖🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. 📦 Bundle sizeSize Change: +642 B (+0.01%) Total Size: 8.85 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
|
This was referenced Oct 16, 2026
Contributor
Author
|
Closing in favour of #84806 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #84761.
What?
Keep the new-tab arrow with the preceding word when
@wordpress/uiLink wraps, including unstyled links and RTL text.Why?
The icon's
inline-blockbox lets the arrow wrap onto a line of its own. This PR coversLinkonly, following the scope discussed on the issue.How?
Keep the icon inline and apply the underline to a text wrapper for styled links. Unstyled links retain their direct children for composition.
Relationship to the earlier Link changes
#77420 removed the original text wrapper to simplify the markup and fix an underline leaking into unstyled links. Its
inline-blockalternative kept the arrow free of underlining, but introduced the wrapping boundary reported here.The wrapper in this change exists only for the default variant and stays the same whether the new-tab indicator is present or absent. This preserves the unstyled behavior used by
ButtonLink. Underline color and thickness inherit from the anchor, including the neutral tone and thefrom-fonttreatment from #77790. The generated arrow, RTL direction, accessible notice, and focus utilities remain in place.Testing Instructions
Run
npm run storybook:devand open Components / @wordpress-ui / Link / Wrapping.Confirm the arrow stays with "phrases" on the second line. Only the link text should be underlined.
Switch
varianttounstyledand confirm the arrow stays attached without adding an underline.Repeat with the RTL toolbar option and both tones. Confirm the arrow points toward the top left in RTL.
Open Link / Truncation and Link / Truncation At Icon. Check both variants and directions with ellipsis on Link and on its parent. The text should stay on one line and truncate with an ellipsis.
Testing Instructions for Keyboard
Screenshots or screencast
Text truncation: before and after
The
TruncationandTruncation At Iconstories check ellipsis on Link itself and on a parent container, with both variants in LTR and RTL. They cover a long label and the boundary where the label nearly fits but the arrow overflows. Before uses the PR base,55b3f987bb4; after uses the Link implementation at3296ad30e6f. Both use the same story, a 480 × 294 viewport, and a device scale factor of 2.The before-and-after images are identical within each browser. Overflow clips the trailing arrow together with the text. The full link label and new-tab notice remain in the accessible-name result. The original issue does not mention truncation; this is an additional compatibility check.
Verification
The four new wrapping cases failed before the fix and pass afterward. All 22 Link and ButtonLink tests pass. The actual Storybook example was also checked in Chromium 153 and WebKit 26.6 for default and unstyled links in LTR and RTL.
Use of AI Tools
Codex assisted with the history review, implementation, tests, browser checks, and PR description.