Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accordion directive ignores Input Id #4668

Open
TheCell opened this issue Jan 30, 2024 · 0 comments
Open

Accordion directive ignores Input Id #4668

TheCell opened this issue Jan 30, 2024 · 0 comments

Comments

@TheCell
Copy link

TheCell commented Jan 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant