Repository navigation
feat: let tabs be closed - #422
Open
andrewhuhh wants to merge 5 commits into
Open
andrewhuhh wants to merge 5 commits into
andrewhuhh wants to merge 5 commits into
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Confidence Score: 5/5
[Low impact] The PR appears safe to merge; the linked-tab issue is fixed and no new actionable issues were found.
|
… on content lists Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s count Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This branch has not been deployed
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.
Adds an optional
onCloseto tab definitions (and toTabsTrigger) for tabs a user can close, such as query editor tabs or open files. A closable tab shows a small close button beside its label, and pressing Delete or Backspace while the tab has focus closes it.This follows the WAI-ARIA tabs pattern. The tab list keeps a single tab stop, and arrow keys move between tabs. The close button is left out of the tab order, so the Delete key is the keyboard path, but it stays available to assistive technology with the name "Close ". The button sits beside the trigger rather than inside it, so clicking it never selects the tab. It fits inside the existing tab height, and the selection indicator and focus ring cover the whole tab.
The caller still owns
valueand decides which tab to select after a close. If focus would otherwise fall to the page body, it returns to the tab that is now active. Closable tabs cap their width and truncate long labels, so the close button stays reachable on narrow screens. The list already scrolls when the tabs overflow.The new "Closable" example on the Tabs page shows a small set of tabs, a set with long file names, and the state after every tab is closed.
Closable tabs truncate only their label (text or element) and keep a Count beside it, and a linked tab (
asChildwith an anchor) stays a single tab stop that follows its link.Visual: four new
tabs-closablebaselines (desktop and mobile, Light and Dark). The example includes a long closable tab with a count. No existing baseline changed.