Commit aef150fb authored by Mohammad Nakhaee's avatar Mohammad Nakhaee
Browse files

Check the entry_id of the selected row

instead of checking the whole object
parent 4981d37b
......@@ -342,7 +342,7 @@ const DatatableRow = React.memo(function DatatableRow({data, selected, uncollaps
if (selected === 'all') {
return [row]
}
const index = selected.indexOf(row)
const index = selected.map(selectedRow => selectedRow.entry_id).indexOf(row.entry_id)
if (index > -1) {
return [...selected.slice(0, index), ...selected.slice(index + 1)]
} else {
......@@ -452,7 +452,7 @@ export const DatatableTable = React.memo(function DatatableTable({children, acti
actions={actions}
details={details}
key={index}
selected={selected === 'all' || selected?.includes(row)}
selected={selected === 'all' || selected?.map(selectedRow => selectedRow.entry_id).includes(row.entry_id)}
uncollapsed={row === uncollapsedRow}
data={row}
onRowUncollapsed={setUncollapsedRow}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment