I have been facing this issue for some time now. I am working with a basic table where selecting a row highlights it. However, I want to enhance my button functionality by adding a "Remove Selection" feature. When clicked, I need the selected row to lose its highlight. Could someone please guide me on what I might be overlooking? Thank you in advance!
Below is the code snippet: LIVE DEMO
<p-table [value]="tableData" selectionMode="single" metaKeySelection="true">
<ng-template pTemplate="header">
<tr>
<th>Company</th>
<th>First Name</th>
<th>Email</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-rowData let-rowIndex="rowIndex">
<tr [pSelectableRow]="rowData">
<td>{{rowData.first_name}}</td>
<td>{{rowData.last_name}}</td>
<td>{{rowData.email}}</td>
</tr>
</ng-template>
</p-table>
<button (click)="removeSelection()">Remove Selection</button>