Repository navigation
fix(Overlay, DropdownMenuGroup, MobileNavToggle): forward host attributes to the element each owns #8755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(Overlay, DropdownMenuGroup, MobileNavToggle): forward host attributes to the element each owns #8755
Changes from 2 commits
3a413fa
82b5b87
a73f5c3
84e7635
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] `Overlay`, `DropdownMenuGroup` and `MobileNavToggle` now forward host attributes and DOM handlers (`id`, `data-*`, `aria-*`, event handlers) to the element each one owns, as other DOM-owning components do. Before, each accepted only `xstyle`, `className`, `style` and `ref` (plus `data-testid` on `MobileNavToggle`) and dropped everything else, so a test id or analytics attribute passed to any of them never reached the page. Built-in behavior stays component-owned: `Overlay`'s touch toggle and `MobileNavToggle`'s drawer toggle run on every press, before a caller handler; `DropdownMenuGroup` keeps its `role="group"` and, while it has a `title`, keeps that title as its name; `MobileNavToggle` keeps its `aria-expanded` and `aria-controls`. | ||
|
|
||
| @kentonquatman | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,7 +133,7 @@ export const docs = { | |
| name: 'MobileNavToggle', | ||
| displayName: 'Mobile Nav Toggle', | ||
| description: | ||
| 'Hamburger button that opens/closes the mobile nav drawer. Reads open state from AppShell context automatically: does NOT accept isOpen or onOpenChange props. Renders nothing above the mobile breakpoint.', | ||
| 'Hamburger button that opens/closes the mobile nav drawer. Reads open state from AppShell context automatically: does NOT accept isOpen or onOpenChange props. Renders nothing above the mobile breakpoint. Host attributes and DOM handlers (id, data-*, aria-*) reach the button; its aria-expanded and aria-controls stay component-owned, and a caller onClick runs after the toggle.', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional wording: a caller |
||
| // The toggle renders null unless AppShell mobile context reports an | ||
| // enabled mobile viewport — the default context outside AppShell never | ||
| // does, so the Properties preview was an empty stage. appShellMobile | ||
|
|
@@ -305,7 +305,7 @@ export const docsDense = { | |
| { | ||
| name: 'MobileNavToggle', | ||
| description: | ||
| 'Hamburger button that opens/closes mobile nav drawer. Reads open state from AppShell context automatically. Renders nothing above mobile breakpoint.', | ||
| 'Hamburger button that opens/closes mobile nav drawer. Reads open state from AppShell context automatically. Renders nothing above mobile breakpoint. Host attributes and handlers reach the button; aria-expanded/aria-controls stay owned.', | ||
| }, | ||
| ], | ||
| propDescriptions: { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.