Resolve issue when selecting lines.
This commit is contained in:
@@ -424,7 +424,7 @@ export function JobLinesComponent({
|
||||
const markedTypes = [e.key];
|
||||
if (e.key === "PAN") markedTypes.push("PAP");
|
||||
if (e.key === "PAS") markedTypes.push("PASL");
|
||||
setSelectedLines(
|
||||
setSelectedLines((selectedLines) =>
|
||||
_.uniq([
|
||||
...selectedLines,
|
||||
...jobLines.filter(
|
||||
@@ -662,8 +662,17 @@ export function JobLinesComponent({
|
||||
onSelectAll: (selected, selectedRows, changeRows) => {
|
||||
setSelectedLines(selectedRows);
|
||||
},
|
||||
onSelect: (record, selected, selectedRows, nativeEvent) =>
|
||||
setSelectedLines(selectedRows),
|
||||
onSelect: (record, selected, selectedRows, nativeEvent) => {
|
||||
if (selected) {
|
||||
setSelectedLines((selectedLines) =>
|
||||
_.uniqBy([...selectedLines, record], "id")
|
||||
);
|
||||
} else {
|
||||
setSelectedLines((selectedLines) =>
|
||||
selectedLines.filter((l) => l.id !== record.id)
|
||||
);
|
||||
}
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user