Skip to content

Commit 6a9f2d0

Browse files
authored
fix(aria/accordion): ensure right attribute is set when used as a host directive (#33839)
Some functionality in the `AccordionGroupPattern` relies on the `ngAccordionTrigger` attribute being present. These changes add it as an explicit host binding in case the directive is used as a host directive.
1 parent bd54848 commit 6a9f2d0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/aria/accordion/accordion-trigger.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ import {AccordionPanel} from './accordion-panel';
5252
'[attr.aria-disabled]': '_pattern.disabled()',
5353
'[attr.disabled]': '_pattern.hardDisabled() ? true : null',
5454
'[attr.tabindex]': '_pattern.tabIndex()',
55+
56+
// `AccordionGroupPattern` depends on this to find the closest
57+
// trigger so ensure that it is set. It's usually there for normal usage,
58+
// but it might not be when the trigger is a host directive.
59+
'ngAccordionTrigger': '',
5560
},
5661
})
5762
export class AccordionTrigger implements OnInit, OnDestroy {

0 commit comments

Comments
 (0)