@snapdragonsnursery/react-components 1.1.34 → 1.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ChildSearchPage.jsx +6 -3
package/package.json
CHANGED
package/src/ChildSearchPage.jsx
CHANGED
|
@@ -207,8 +207,11 @@ const ChildSearchPage = ({
|
|
|
207
207
|
getCoreRowModel: getCoreRowModel(),
|
|
208
208
|
getSortedRowModel: getSortedRowModel(),
|
|
209
209
|
state: {
|
|
210
|
-
rowSelection: selectedChildrenState.reduce((acc,
|
|
211
|
-
|
|
210
|
+
rowSelection: selectedChildrenState.reduce((acc, selectedChild) => {
|
|
211
|
+
const rowIndex = children.findIndex(child => child.child_id === selectedChild.child_id);
|
|
212
|
+
if (rowIndex !== -1) {
|
|
213
|
+
acc[rowIndex] = true;
|
|
214
|
+
}
|
|
212
215
|
return acc;
|
|
213
216
|
}, {}),
|
|
214
217
|
},
|
|
@@ -421,7 +424,7 @@ const ChildSearchPage = ({
|
|
|
421
424
|
{title}
|
|
422
425
|
</h1>
|
|
423
426
|
{multiSelect && (
|
|
424
|
-
<div className="mt-
|
|
427
|
+
<div className="mt-4 flex items-center space-x-2">
|
|
425
428
|
<span className="px-3 py-1 text-sm bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200 rounded-full">
|
|
426
429
|
{selectedChildrenState.length} selected
|
|
427
430
|
{maxSelections && ` / ${maxSelections}`}
|