ngx-bootstrapng2-bootstrap

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


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>

Solution

  • I fixed it using

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

    Hopefully will help someone someday!