@linzjs/step-ag-grid 29.3.3 → 29.3.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.
@@ -2763,7 +2763,13 @@ agGridCommunity.ModuleRegistry.registerModules([agGridCommunity.AllCommunityModu
2763
2763
  * Wrapper for AgGrid to add commonly used functionality.
2764
2764
  */
2765
2765
  const Grid = ({ 'data-testid': dataTestId, defaultPostSort = true, rowSelection = 'multiple', suppressColumnVirtualization = true, theme = 'ag-theme-step-default', sizeColumns = 'auto', selectColumnPinned = 'left', contextMenuSelectRow = false, singleClickEdit = false, rowData, rowHeight = theme === 'ag-theme-step-default' ? 40 : theme === 'ag-theme-step-compact' ? 36 : 40, selectable, onCellFocused: paramsOnCellFocused, maxInitialWidth, ...params }) => {
2766
- const { gridReady, gridRenderState, setApis, ensureRowVisible, getFirstRowId, selectRowsById, focusByRowById, ensureSelectedRowIsVisible, autoSizeColumns, sizeColumnsToFit, externallySelectedItemsAreInSync, setExternallySelectedItemsAreInSync, isExternalFilterPresent, doesExternalFilterPass, setOnBulkEditingComplete, getColDef, showNoRowsOverlay, prePopupOps, startCellEditing, } = useGridContext();
2766
+ const { gridReady, gridRenderState, setApis, ensureRowVisible, getFirstRowId, selectRowsById, focusByRowById, ensureSelectedRowIsVisible, autoSizeColumns, sizeColumnsToFit, externallySelectedItemsAreInSync, setExternallySelectedItemsAreInSync, isExternalFilterPresent, doesExternalFilterPass, setOnBulkEditingComplete, getColDef, showNoRowsOverlay, prePopupOps, startCellEditing: propStartCellEditing, } = useGridContext();
2767
+ // CellEditingStop event happens too much for one edit
2768
+ const startedEditRef = React.useRef(false);
2769
+ const startCellEditing = React.useCallback((props) => {
2770
+ startedEditRef.current = true;
2771
+ return propStartCellEditing(props);
2772
+ }, [propStartCellEditing]);
2767
2773
  const { updatedDep, anyUpdating, updatingCols } = React.useContext(GridUpdatingContext);
2768
2774
  const gridDivRef = React.useRef(null);
2769
2775
  const lastSelectedIds = React.useRef([]);
@@ -3043,6 +3049,10 @@ const Grid = ({ 'data-testid': dataTestId, defaultPostSort = true, rowSelection
3043
3049
  }
3044
3050
  }, [singleClickEdit, startCellEditing]);
3045
3051
  const onCellEditingStopped = React.useCallback((event) => {
3052
+ if (!startedEditRef.current) {
3053
+ return;
3054
+ }
3055
+ startedEditRef.current = false;
3046
3056
  const api = event.api;
3047
3057
  // We need to redraw on fit as the updated row heights aren't visible
3048
3058
  if (sizeColumns === 'fit') {