ng-bootstrap icon indicating copy to clipboard operation
ng-bootstrap copied to clipboard

Accordion directive ignores Input Id

Open TheCell opened this issue 1 year ago • 0 comments

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.

image

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 17.1.1 ng-bootstrap: 16.0.0 Bootstrap: 5.3.2

TheCell avatar Jan 30 '24 14:01 TheCell