@linzjs/step-ag-grid 29.3.3 → 29.3.5
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/dist/index.css +4 -0
- package/dist/step-ag-grid.cjs +11 -1
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +11 -1
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +16 -2
- package/src/styles/Grid.scss +4 -0
package/package.json
CHANGED
package/src/components/Grid.tsx
CHANGED
|
@@ -30,7 +30,7 @@ import { defer, delay, difference, isEmpty, last, omit, xorBy } from 'lodash-es'
|
|
|
30
30
|
import { ReactElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
31
31
|
import { useInterval } from 'usehooks-ts';
|
|
32
32
|
|
|
33
|
-
import { AutoSizeColumnsResult, useGridContext } from '../contexts/GridContext';
|
|
33
|
+
import { AutoSizeColumnsResult, StartCellEditingProps, useGridContext } from '../contexts/GridContext';
|
|
34
34
|
import { GridUpdatingContext } from '../contexts/GridUpdatingContext';
|
|
35
35
|
import { fnOrVar, isNotEmpty } from '../utils/util';
|
|
36
36
|
import { clickInputWhenContainingCellClicked } from './clickInputWhenContainingCellClicked';
|
|
@@ -170,8 +170,18 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
|
|
|
170
170
|
getColDef,
|
|
171
171
|
showNoRowsOverlay,
|
|
172
172
|
prePopupOps,
|
|
173
|
-
startCellEditing,
|
|
173
|
+
startCellEditing: propStartCellEditing,
|
|
174
174
|
} = useGridContext<TData>();
|
|
175
|
+
// CellEditingStop event happens too much for one edit
|
|
176
|
+
const startedEditRef = useRef(false);
|
|
177
|
+
const startCellEditing = useCallback(
|
|
178
|
+
(props: StartCellEditingProps) => {
|
|
179
|
+
startedEditRef.current = true;
|
|
180
|
+
return propStartCellEditing(props);
|
|
181
|
+
},
|
|
182
|
+
[propStartCellEditing],
|
|
183
|
+
);
|
|
184
|
+
|
|
175
185
|
const { updatedDep, anyUpdating, updatingCols } = useContext(GridUpdatingContext);
|
|
176
186
|
|
|
177
187
|
const gridDivRef = useRef<HTMLDivElement>(null);
|
|
@@ -497,6 +507,10 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
|
|
|
497
507
|
|
|
498
508
|
const onCellEditingStopped = useCallback(
|
|
499
509
|
(event: AgGridEvent<TData>) => {
|
|
510
|
+
if (!startedEditRef.current) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
startedEditRef.current = false;
|
|
500
514
|
const api = event.api;
|
|
501
515
|
// We need to redraw on fit as the updated row heights aren't visible
|
|
502
516
|
if (sizeColumns === 'fit') {
|
package/src/styles/Grid.scss
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
margin-right: auto;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.ag-unselectable {
|
|
11
|
+
user-select: text !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
.LabelPreferencesPanelGridCellAlignCenter .ag-cell-wrapper, .LabelPreferencesPanelGridCellAlignCenter .GridCell-container {
|
|
11
15
|
display: flex;
|
|
12
16
|
justify-content: center;
|