I am using react data table for my project. currently I am using column filtering feature and column sort feature. This is my table header.
<thead>
{headerGroups.map((headerGroup) => (
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map((column) => (
<th {...column.getHeaderProps(column.getSortByToggleProps())}>
{column.render("Header")}
<span>
{column.isSorted ? (
column.isSortedDesc ? (
<i class="mdi mdi-menu-down sort-arrow"></i>
) : (
<i class="mdi mdi-menu-up sort-arrow"></i>
)
) : (
""
)}
</span>
<div>{column.canFilter ? column.render("Filter") : null}</div>
</th>
))}
<th>Action</th>
</tr>
))}
</thead>
Column filter and Column sort features are working correctly. but my problem is, when I click column filter textbox, column sort start to fire and sorting header. Reason is all element is inside the same'th'. how I solve this issue.