-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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: [activeIndex] not bound when accordion tabs are created with *ngFor #4458
Comments
Hi. I was having an issue similar to #4530 but with the accordion component and realized this is related. I was able to modify the first plunkr to make it work: http://plnkr.co/edit/CiiMvAEPZ5pDOwUgYXGy?p=preview Hope this helps. |
Error still happening as of 7.1.3 (latest) |
Has anyone found a work around for this issue that works without setting the selected on the accordionTab? My current setup is that I have a parent component with the accordion and then child components with the accordionTab, and I really don't want to have to add an input to get the Array for the active indexes so that each child component can see if they need to set the selected input. Also, I am truly just wanting to have the accordion expanded if it is the only one if there is an easier way to do that. |
Error still happening on primeNG v8.0.2 with Angular v8.2.0 (see StackBlitz example). I have a child component with an accordion where the accordion tabs are created with When I try to set Then I tried a |
hi Riorudo, please check my workaround solution in your forked example
` after calling THIS WORKAROUND SOLUTION IS WORKING ALSO IN PRIME NG V6 |
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Clean - http://plnkr.co/edit/raJGQkHfwzkEaxVOmRnW?p=preview
With AfterViewInit - http://plnkr.co/edit/ktGFyScZJUabh6QfQiEG?p=preview
With setTimeout() - http://plnkr.co/edit/KeqOc8nZhUaJrGAw6cKR?p=preview
Current behavior
Clean - all accordion tabs stay closed
With AfterViewInit - there's an Angular exception 'Expression has changed after it was checked.'
With setTimeout - only the first accordion tab stays open, the other do not respond to user interaction at all.
Expected behavior
We should be able to set an active accordion tab index initially, ideally without resolving to any hacks. Even setTimeout didn't work this time.
Angular version: 4.4.3
PrimeNG version: 4.2.1
The text was updated successfully, but these errors were encountered: