ng-bootstrap
ng-bootstrap copied to clipboard
Accordion directive ignores Input Id
Bug description:
I think this is a bug. The new ngbAccordion is a directive. We usually set our own unique Ids for ngbAccordionItems (previously panels) but with the new system the Input for id is overwritten.
It seems as if line 193 in https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/accordion/accordion.directive.ts private _id = `ngb-accordion-item-${nextId++}`;
is ignoring whatever @Input('ngbAccordionItem') set id(id: string)
has as input at the start.
Link to minimally-working StackBlitz that reproduces the issue:
Working Example You can see that I set a custom Id in the template but it's ignored when I log it to the console or display it in the template.
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 17.1.1 ng-bootstrap: 16.0.0 Bootstrap: 5.3.2