I have used ngx-accordion like
<form [formGroup]="Form" (ngSubmit)="Form()">
<input type="text" (ngModel)="fieldone" name="fieldone" />
<accordion>
<accordion-group heading="Heading">
<input type="text" (ngModel)="fieldtwo" name="fieldtwo" />
</accordion-group>
</accordion>
</form>
On browser view, when click on Heading form submit event fires because
Heading render something like
<button class="btn btn-link ng-star-inserted" ng-reflect-klass="btn btn-link" ng-reflect-ng-class="[object Object]">Heading </button>
how should i add type="button" in button tags
@Varun-Saini
We adhere to the behavior of the Bootstrap functionality.
Also, you shouldn't add type="button" into button tag.
I'm affected by this issue as well. To clarify, Bootstrap do explicitly specify the type attribute for buttons (https://getbootstrap.com/docs/4.1/components/collapse/#accordion-example), as the default value is submit for a button (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
I've created a new bug as this one is closed. #5206 5206
Workaround
enclose the <accordion> with a similarity div statement:
<div onclick="return false;">
Most helpful comment
I'm affected by this issue as well. To clarify, Bootstrap do explicitly specify the type attribute for buttons (https://getbootstrap.com/docs/4.1/components/collapse/#accordion-example), as the default value is submit for a button (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type)
I've created a new bug as this one is closed. #5206 5206