Skip to content

feat(design): add aria-controls support to DaffMenuComponent#4315

Open
fiona-cai wants to merge 3 commits intograycoreio:developfrom
fiona-cai:feat/aria-controls
Open

feat(design): add aria-controls support to DaffMenuComponent#4315
fiona-cai wants to merge 3 commits intograycoreio:developfrom
fiona-cai:feat/aria-controls

Conversation

@fiona-cai
Copy link
Contributor

PR Checklist

  • Commit message follows our contributing guidelines
  • Tests added/updated (for bug fixes/features)
  • Documentation added/updated (for bug fixes/features)

PR Type

  • Bug fix
  • Feature
  • Style update
  • Refactor
  • Test
  • Build
  • CI
  • Docs
  • Performance
  • Other (please describe)

Current behavior

Fixes: #4159

New behavior

  • Add unique id on DaffMenuComponent (generated + optional @input override)
  • Set aria-controls on daffMenuActivator linked to menu id via DAFF_MENU_ID token
  • Update DaffMenuService to pass menuId when opening and inject into portal
  • Add unit tests for id and aria-controls behavior

Breaking change?

  • Yes
  • No

Additional context

@fiona-cai fiona-cai requested a review from a team as a code owner February 2, 2026 16:21
@xelaint xelaint self-requested a review February 2, 2026 16:24
@xelaint xelaint added package: design @daffodil/design status: pending review This PR is awaiting review or response from a reviewer before the author can proceed. labels Feb 2, 2026
@xelaint xelaint changed the title feat(design/menu): add aria-controls support to DaffMenuComponent feat(design): add aria-controls support to DaffMenuComponent Feb 2, 2026
Assistive technologies need a stable association between the menu activator
and the menu panel. Previously the menu had no id and the activator had no
aria-controls.

- Add unique id on DaffMenuComponent (generated + optional @input override)
- Set aria-controls on daffMenuActivator linked to menu id via DAFF_MENU_ID token
- Update DaffMenuService to pass menuId when opening and inject into portal
- Add unit tests and documentation for id and aria-controls behavior

Closes graycoreio#4159
… in spec

The test must use toHaveBeenCalledWith to satisfy lint but cannot reference
the directive's private viewContainerRef. Assert the first argument with
jasmine.anything() and the remaining args as before.
Copy link
Member

@xelaint xelaint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fiona-cai
Copy link
Contributor Author

fix(design): resolve spec failures in textarea, tree, and progress-bar should be moved to a separate PR

is there a current issue open for it?

@xelaint
Copy link
Member

xelaint commented Feb 3, 2026

fix(design): resolve spec failures in textarea, tree, and progress-bar should be moved to a separate PR

is there a current issue open for it?

#4317

I created the issue since the updates are valid, but these tests don't actually fail on my end since the tests itself don't rely on the missing imports. Are they actually causing a fail on your end?

@fiona-cai
Copy link
Contributor Author

yeah, they do

…ssertion

Assert only the third argument (menu id); second arg can be TemplateRef
before component.daffMenuActivator is set in test context.
@xelaint
Copy link
Member

xelaint commented Feb 3, 2026

yeah, they do

okay that's interesting since the CI pipeline passes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: design @daffodil/design status: pending review This PR is awaiting review or response from a reviewer before the author can proceed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add aria-controls support to DaffMenuComponent

2 participants