Repository navigation
Tabs: Add horizontal scrolling for non-wrapping tab lists - #80247
Mustafabharmal wants to merge 1 commit into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Mayank-Tripathi32
left a comment
There was a problem hiding this comment.
Thanks for opening PR,
Two things to confirm:
-
long tab labels don't line-break when scrolling (the explicit requirement in [#80239]. flex-shrink: 0 should cover it, but a screenshot with long labels would settle it),
-
and
allowWrap: falsewas set deliberately just a month ago in #77646 as part of narrowing Tabs to essential options. #80239 seems like good place to discuss, Lets see if @t-hamano can confirm that resurfacing the generic wrap toggle is the intended way to deliver a "scroll option".
What?
Closes #80239.
Adds support for disabling wrapping in the Tab List block and enables horizontal scrolling when wrapping is turned off.
Why?
The Tab List block now wraps onto multiple lines by default, which provides a better experience when many tabs are present.
However, the block did not expose the existing
allowWraplayout support, so authors could not choose to keep the tab list on a single row.Simply enabling that layout support is not sufficient. When wrapping is disabled, the tab list can overflow its container and individual tab buttons shrink, causing tab labels to wrap onto multiple lines.
This change completes the non-wrapping experience by allowing the tab list to scroll horizontally while preserving each tab's natural width.
How?
This PR builds on Gutenberg's existing flex layout support.
allowWraplayout support for the Tab List block..is-nowrapclass added by the layout system when wrapping is disabled.Testing Instructions
Screenshots or screencast
Before
Tab.blocks.Before.fix.mov
After
Tab.blocks.After.fix.mov