@opencorestack/opengridx 1.0.2 → 1.0.4

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.
@@ -202,6 +202,18 @@ export function DataGrid<R extends GridRowModel = GridRowModel>(props: DataGridP
202
202
  const defaultGetRowId = useCallback((row: R) => row.id, []);
203
203
  const effectiveGetRowId = getRowId || defaultGetRowId;
204
204
 
205
+ // Normalize rows so every row has `id === getRowId(row)`.
206
+ // createInitialState and SET_ROWS both key the internal store by row.id,
207
+ // so rows without a native id field collide on undefined without this.
208
+ // When getRowId is the default (row) => row.id this is a no-op per row.
209
+ const normalizedRows = useMemo(
210
+ () => activeRows.map(row => {
211
+ const id = effectiveGetRowId(row);
212
+ return id === row.id ? row : ({ ...row, id } as R);
213
+ }),
214
+ [activeRows, effectiveGetRowId]
215
+ );
216
+
205
217
  // Keyboard-mode flag: toggled via DOM classname — no React state needed
206
218
  // so the ring appears instantly without a re-render cycle.
207
219
  const setKeyboardMode = useCallback((on: boolean) => {
@@ -226,7 +238,7 @@ export function DataGrid<R extends GridRowModel = GridRowModel>(props: DataGridP
226
238
  }, [treeData]);
227
239
 
228
240
  const gridData = useDataGrid({
229
- rows: activeRows,
241
+ rows: normalizedRows,
230
242
  columns: activeColumns,
231
243
  rowHeight,
232
244
  headerHeight,
@@ -358,9 +370,9 @@ export function DataGrid<R extends GridRowModel = GridRowModel>(props: DataGridP
358
370
 
359
371
  useEffect(() => {
360
372
  if (!dataSource) {
361
- setRows(activeRows);
373
+ setRows(normalizedRows);
362
374
  }
363
- }, [activeRows, setRows, dataSource]);
375
+ }, [normalizedRows, setRows, dataSource]);
364
376
 
365
377
  // ── Detail panel (hoisted — hasDetailPanel feeds into useGridColumns) ──────
366
378
  const hasDetailPanel = Boolean(getDetailPanelContent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencorestack/opengridx",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "OpenGridX: High-performance React data infrastructure. Unlock advanced Row Grouping, Excel Export, and Column Pinning without the usual \"Pro\" gatekeeping. Built for speed, scale, and complete architectural freedom. Fully open, virtualization-ready, and feature-complete.",
5
5
  "type": "module",
6
6
  "main": "./dist/opengridx.umd.js",