@linzjs/step-ag-grid 14.3.0 → 14.3.2

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
@@ -2,7 +2,7 @@
2
2
  "name": "@linzjs/step-ag-grid",
3
3
  "repository": "github:linz/step-ag-grid.git",
4
4
  "license": "MIT",
5
- "version": "14.3.0",
5
+ "version": "14.3.2",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -82,7 +82,7 @@ export const Grid = ({
82
82
  suppressColumnVirtualization = true,
83
83
  theme = "ag-theme-alpine",
84
84
  sizeColumns = "auto",
85
- selectColumnPinned = "left",
85
+ selectColumnPinned = null,
86
86
  ...params
87
87
  }: GridProps): JSX.Element => {
88
88
  const {
@@ -411,36 +411,29 @@ export const GridContextProvider = <RowType extends GridBaseRow>(props: GridCont
411
411
  );
412
412
  };
413
413
 
414
- let foundEditableCell = false;
415
-
416
414
  // Just in case I've missed something, we don't want the loop to hang everything
417
- let maxIterations = 50;
418
- let preRow: CellPosition | null = null;
419
- let postRow: CellPosition | null = null;
420
- do {
421
- preRow = gridApi.getFocusedCell();
415
+ for (let maxIterations = 0; maxIterations < 50; maxIterations++) {
416
+ const preRow = gridApi.getFocusedCell();
422
417
  tabDirection === 1 ? gridApi.tabToNextCell() : gridApi.tabToPreviousCell();
423
- postRow = gridApi.getFocusedCell();
424
- foundEditableCell = focusedCellIsEditable();
425
- } while (
426
- preRow?.rowIndex === postRow?.rowIndex &&
427
- preRow?.column !== postRow?.column &&
428
- !foundEditableCell &&
429
- maxIterations-- > 0
430
- );
431
-
432
- if (foundEditableCell) {
433
- prePopupOps();
434
- const focusedCell = gridApi?.getFocusedCell();
435
- if (focusedCell) {
436
- gridApi.startEditingCell({
437
- rowIndex: focusedCell.rowIndex,
438
- colKey: focusedCell.column.getColId(),
439
- });
440
- return false;
418
+ const postRow = gridApi.getFocusedCell();
419
+ if (preRow?.rowIndex !== postRow?.rowIndex || preRow?.column === postRow?.column) {
420
+ // We didn't find an editable cell in the same row, or the cell column didn't change
421
+ // implying it was start/end of grid
422
+ break;
423
+ }
424
+ if (focusedCellIsEditable()) {
425
+ const focusedCell = gridApi?.getFocusedCell();
426
+ if (focusedCell) {
427
+ prePopupOps();
428
+ gridApi.startEditingCell({
429
+ rowIndex: focusedCell.rowIndex,
430
+ colKey: focusedCell.column.getColId(),
431
+ });
432
+ return true;
433
+ }
441
434
  }
442
435
  }
443
- return true;
436
+ return false;
444
437
  },
445
438
  [gridApi, prePopupOps],
446
439
  );
@@ -494,7 +487,7 @@ export const GridContextProvider = <RowType extends GridBaseRow>(props: GridCont
494
487
  prePopupFocusedCell.current.rowIndex == postPopupFocusedCell.rowIndex &&
495
488
  prePopupFocusedCell.current.column.getColId() == postPopupFocusedCell.column.getColId()
496
489
  ) {
497
- if (!tabDirection || selectNextEditableCell(tabDirection)) {
490
+ if (!tabDirection || !selectNextEditableCell(tabDirection)) {
498
491
  cellEditingCompleteCallbackRef.current && cellEditingCompleteCallbackRef.current();
499
492
  }
500
493
  }