igx-tree-grid- when placed inside angular template driven form, pagination click is considered as form submission
Description
When igx-tree-grid is placed inside angular template driven form, pagination click is considered as form submission. May be pagination buttons are of type="submit", hence invoking form submit method. Is there a way to configure pagination buttons or is there any other cause for this issue?
- igniteui-angular version: 7.2.4
- browser: IE 11
Steps to reproduce
- Place 'igx-tree-grid' (with [perPage]="5" [paging]="true") inside angular template driven form (say, name="formTest" role="form" (ngSubmit)="onSubmit()" #formTest="ngForm")
- Click on next page in the grid.
Result
This invokes onSubmit() method.
Expected result
This shouldn't invoke onSubmit() method and must display next page data in the grid.
Attachments
Attach a sample if available, and screenshots, if applicable.

A <button> element is by default of type="submit". Just add type="button" to the pager buttons.
Could you please share sample code to add type="button" to igx-tree-grid pager buttons.
I added type="button" attributes to the paging buttons in the tree grid paging sample in this stackblitz example
I did not use [paginationTemplate]="pager" in my actual code (though you can see it in the screenshot that I included here). I just added [perPage]="5" [paging]="true" to get pagination. Is there any way I could make this work without using [paginationTemplate]="pager"?
Well, without the template, if the tree grid absolutely has to be inside a form element, then no. But if it doesn't have to be, then if you move it outside the form, it wouldn't submit.
I did not add the template as pagination was working fine without that (except for this issue). I added it now and it doesn't submit now. Thanks for your quick responses. My issue is resolved.