Skip to content

refactor(multiple): rework LabelControl across aria components#33146

Open
adolgachev wants to merge 3 commits intoangular:mainfrom
adolgachev:aria-labels
Open

refactor(multiple): rework LabelControl across aria components#33146
adolgachev wants to merge 3 commits intoangular:mainfrom
adolgachev:aria-labels

Conversation

@adolgachev
Copy link
Copy Markdown
Contributor

@adolgachev adolgachev commented Apr 24, 2026

Refactors to make LabelControl easier to use by directives directly:

  • default labelledby id input can be set by a string instead of requiring it to create an array
  • all inputs are now required as benefit of the control is when all are used and properly coordinated
  • output labelledby now returns a string so can be used directly with aria-labelledby
  • added to public api so can be used outside of private package

Added proper usage to AccordionPanel and TabPanel so default labelledby still set properly to the respective AccordionTrigger or Tab, but also could be overridden. Although not recommended to do so.

@adolgachev adolgachev added dev-app preview When applied, previews of the dev-app are deployed to Firebase target: major This PR is targeted for the next major release action: review The PR is still awaiting reviews from at least one requested reviewer labels Apr 24, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

Deployed dev-app for a867429 to: https://ng-dev-previews-comp--pr-angular-components-33146-dev-qadmum20.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@adolgachev adolgachev marked this pull request as ready for review April 28, 2026 17:26
@pullapprove pullapprove Bot requested review from crisbeto and ok7sai April 28, 2026 17:26
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we stop the "I want this in my own style" kind of refactoring? I don't see the core functionality has changed after touching almost every single line.

});

constructor() {
this._labelControl = new LabelControl({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should put this in the UI pattern to keep the directive a thin layer between the framework and the core library.

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

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: aria/accordion area: aria/tabs detected: feature PR contains a feature commit dev-app preview When applied, previews of the dev-app are deployed to Firebase target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants