ngx-bootstrap: Exclude element in heading from closing an accordion item

458 Views Asked by At

Is there a way to exclude a certain element in the accordion-heading custom HTML from opening and closing the accordion?

For example,

<accordion>
    <accordion-group>
        <div accordion-heading>
            <span>This should close the accordion element (the default behavior)</span>
            <span>This should not close it</span>
        </div>
    </accordion-group>
</accordion>
1

There are 1 best solutions below

0
callback On BEST ANSWER

I fixed it using

<span (click)="$event.stopPropagation()">This should not close it</span>

Hopefully will help someone someday!