Programmatic element (pre-)selection on datatable fails when using dataKey #3618
Labels
Status: Pending Review
Issue or pull request is being reviewed by Core Team
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
I'm submitting
Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.
http://plnkr.co/edit/UZiAHEmvc3IldUTHTNyH?p=preview
Current behavior
Setting a selected item on a datatable that uses a dataKey does not work in single selction mode. The selection object and the selection keys are not correctly initialized, when selection is a single object instead of an array.
Expected behavior
Setting the selected item as object in single selection mode should use the datakey property to check equality.
Minimal reproduction of the problem with instructions
http://plnkr.co/edit/UZiAHEmvc3IldUTHTNyH?p=preview
** Issue and Fix
primeng/src/app/components/datatable/datatable.ts
Lines 851 to 855 in d75ad83
The text was updated successfully, but these errors were encountered: