Repository navigation
fix(Menu): correct roles on GroupHeading and Separator - #2091
Merged
huntabyte merged 1 commit intoSep 8, 2026
Merged
Conversation
GroupHeading and Separator both rendered role="group", putting empty groups into the accessibility tree. Drop the role from GroupHeading (matching Select/Command, whose group headings set no role) and give Separator its own separator role (matching the top-level Separator component).
🦋 Changeset detectedLatest commit: e2a1f14 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
Contributor
Author
|
All three exhaust The case this PR adds ( |
huntabyte
approved these changes
Sep 8, 2026
Merged
dadezzz
pushed a commit
to dadezzz/events-cash-register
that referenced
this pull request
Sep 12, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [bits-ui](https://github.com/huntabyte/bits-ui) | [`2.19.0` → `2.19.1`](https://renovatebot.com/diffs/npm/bits-ui/2.19.0/2.19.1) |  |  | --- ### Release Notes <details> <summary>huntabyte/bits-ui (bits-ui)</summary> ### [`v2.19.1`](https://github.com/huntabyte/bits-ui/releases/tag/bits-ui%402.19.1) [Compare Source](https://github.com/huntabyte/bits-ui/compare/bits-ui@2.19.0...bits-ui@2.19.1) ##### Patch Changes - fix(Avatar): detach image handlers on destroy and actually apply the load cleanup - [#​2050](huntabyte/bits-ui#2050) ([#​2128](huntabyte/bits-ui#2128)) - fix(Menu): `Menu.GroupHeading` no longer sets `role="group"`, `Menu.Separator` now sets `role="separator"` ([#​2091](huntabyte/bits-ui#2091)) - fix(DismissibleLayer): guard the deferred focus handler against teardown - [#​2080](huntabyte/bits-ui#2080) ([#​2126](huntabyte/bits-ui#2126)) - fix(DateField): apply date segments in year/month/day order so a valid day isn't clamped by the placeholder's month in day-first locales ([#​2123](huntabyte/bits-ui#2123)) - fix(Select): keep the user's scroll position when the scroll down button remounts. The button unmounts at the bottom of the list and remounts as soon as the viewport leaves it, and its mount effect realigned the viewport onto the highlighted item, so a small scroll up from the bottom jumped back to the highlighted item. ([#​2109](huntabyte/bits-ui#2109)) - fix(DismissibleLayer): outside clicks shortly after a layer opens no longer fail to dismiss it ([#​2111](huntabyte/bits-ui#2111)) `DismissibleLayerState` reset its per-interaction state through a 20ms debounce. Because the layer's `watch` runs its cleanup once on every open, each layer scheduled a reset 20ms into its own lifetime. An outside `pointerdown` landing 10-20ms after that cleanup had its "responsible layer" flag cleared by the stale reset before the debounced interact-outside handler ran, so the handler bailed and the layer stayed open. The reset is now synchronous. - fix(ScrollArea): prevent resize work from reading destroyed state after unmount ([#​2122](huntabyte/bits-ui#2122)) - fix(Combobox): highlight the first matching item after custom filtering updates the rendered items. ([#​2129](huntabyte/bits-ui#2129)) - fix(Accordion): cancel deferred content work on destroy to avoid `derived_inert` ([#​2127](huntabyte/bits-ui#2127)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC43OS42IiwidXBkYXRlZEluVmVyIjoiNDQuNzkuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
This branch was successfully 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.
Fixes #2090.
Menu.GroupHeadingandMenu.Separatorboth renderrole="group", so a menu that uses them ends up with empty groups in the accessibility tree — a group whose only content is a heading, and another whose only content is a divider.https://github.com/huntabyte/bits-ui/blob/main/packages/bits-ui/src/lib/bits/menu/menu.svelte.ts#L1630
https://github.com/huntabyte/bits-ui/blob/main/packages/bits-ui/src/lib/bits/menu/menu.svelte.ts#L1658
Both look like copy-paste from
MenuGroupStateright above them.The fix follows conventions already in this repo
GroupHeading→ no role.SelectGroupHeadingStateandCommandGroupHeadingStateset only anid, and that is enough: the heading names its group through the group'saria-labelledby, which references it byidand does not depend on a role.Separator→role="separator". The top-levelSeparatorRootStatealready resolvesdecorative ? "none" : "separator", so the menu one was the odd one out.MenuGroupState,MenuRadioGroupStateandMenuCheckboxGroupStatekeeprole="group"— correct for those.Testing
Added a case to
dropdown-menu.browser.test.tsasserting the group is the onlygroup, the separator is aseparator, the heading carries no role, and the heading still names its group viaaria-labelledby. Reverting either line of the fix turns it red.pnpm -F tests test:browser --browser chromium:dropdown-menu— 45 passedcontext-menu+menubar(samemenu.svelte.ts) — 49 passed, 1 skippedpnpm lintclean,prettier --checkclean, changeset included (patch).Note for consumers
Anyone who worked around this by overriding
roleafter spreading props (that was us) can drop the override once this lands —GroupHeadingwill render no role at all, so a stalerole={undefined}override stays harmless either way.