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 - unable to cancel an event #4658

Open
dkaczor97 opened this issue Jan 12, 2024 · 2 comments
Open

Accordion - unable to cancel an event #4658

dkaczor97 opened this issue Jan 12, 2024 · 2 comments

Comments

@dkaczor97
Copy link

Bug description:

Hi! I have upgraded from v13 to v16. I've noticed a big breaking change in Accordion's behaviour.
I've had a few panels where there were forms. I was checking if the form is dirty before a panel was collapsed. I was able to do it with panelChange event and preventDefault function in it's payload.
Now I can only subscribe to hide event which gives me only id of panel being collapsed. I have no option to cancel the event.

Link to minimally-working StackBlitz that reproduces the issue:

https://stackblitz.com/edit/angular-nfcfc3?file=src%2Fapp%2Faccordion-basic.ts

Versions of Angular, ng-bootstrap and Bootstrap:

Angular: 17
ng-bootstrap: 16

@maxokorokov
Copy link
Member

I think the idea was that [disabled]="true" will cover this use case:

<div ngbAccordionItem="form1" [collapsed]="false" [disabled]="true">

Now I'm not that sure from the a11y point of view. Item is not focusable like this.

@jcompagner
Copy link

but the tab is not disabled (the other tab where you click on)
it is enabled, you are allowed to go to that, but maybe we really want to cancel it
are you saying that we need to disable all the tabs upfront? so you can't go to it at the first place?
so if you are in a tab and what ever you do in the tab means you need to then disabled the other tabs?

Problem is that you don't really know this all the time, and its very cumbersome to constantly check this.

We even have server side validation, so what we did before was really "onBeforeChange"
we always didn't let it go through, then the server side call came back and that decided then afterward if we can go through or not..
how would you do that with just disabled? We don't want to disable any tabs, we just want to be in full control of going to another tab..

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

No branches or pull requests

3 participants