@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapdragonsnursery/react-components",
3
- "version": "1.1.34",
3
+ "version": "1.1.36",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -207,8 +207,11 @@ const ChildSearchPage = ({
207
207
  getCoreRowModel: getCoreRowModel(),
208
208
  getSortedRowModel: getSortedRowModel(),
209
209
  state: {
210
- rowSelection: selectedChildrenState.reduce((acc, child, index) => {
211
- acc[index] = true;
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-2 flex items-center space-x-2">
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}`}