@linzjs/step-ag-grid 22.2.0 → 22.2.1
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/src/components/clickInputWhenContainingCellClicked.d.ts +1 -1
- package/dist/step-ag-grid.cjs.js +8 -13
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +8 -13
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/clickInputWhenContainingCellClicked.tsx +11 -14
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -2337,9 +2337,13 @@ const useGridContextMenu = ({ contextMenuSelectRow, contextMenu: ContextMenu, })
|
|
|
2337
2337
|
* AgGrid checkbox select does not pass clicks within cell but not on the checkbox to checkbox.
|
|
2338
2338
|
* This passes the event to the checkbox when you click anywhere in the cell.
|
|
2339
2339
|
*/
|
|
2340
|
-
const clickInputWhenContainingCellClicked = (
|
|
2340
|
+
const clickInputWhenContainingCellClicked = (params) => {
|
|
2341
|
+
const { data, event, colDef } = params;
|
|
2341
2342
|
if (!data || !event)
|
|
2342
2343
|
return;
|
|
2344
|
+
if (fnOrVar(colDef.editable, params) === false) {
|
|
2345
|
+
return;
|
|
2346
|
+
}
|
|
2343
2347
|
const element = event.target;
|
|
2344
2348
|
// Already handled
|
|
2345
2349
|
if (["BUTTON", "INPUT"].includes(element?.tagName) && element.closest(".ag-cell-inline-editing"))
|
|
@@ -2350,25 +2354,16 @@ const clickInputWhenContainingCellClicked = ({ data, event, colDef }) => {
|
|
|
2350
2354
|
const colId = colDef.colId;
|
|
2351
2355
|
if (!colId)
|
|
2352
2356
|
return;
|
|
2353
|
-
const clickInput = (
|
|
2357
|
+
const clickInput = () => {
|
|
2354
2358
|
const cell = row.querySelector(`[col-id='${colId}']`);
|
|
2355
2359
|
if (!cell)
|
|
2356
2360
|
return;
|
|
2357
2361
|
const input = cell.querySelector("input, button");
|
|
2358
|
-
if (!input)
|
|
2359
|
-
return;
|
|
2360
|
-
}
|
|
2361
|
-
// When clicking on a cell that is not editing, the cell changes to editing and the input/button ref becomes invalid
|
|
2362
|
-
// So wait until the cell is in edit mode before sending the click
|
|
2363
|
-
if (!input.ownerDocument.contains(input)) {
|
|
2364
|
-
if (cnt !== 0) {
|
|
2365
|
-
setTimeout(() => clickInput(cnt - 1));
|
|
2366
|
-
}
|
|
2362
|
+
if (!input)
|
|
2367
2363
|
return;
|
|
2368
|
-
}
|
|
2369
2364
|
input?.dispatchEvent(event);
|
|
2370
2365
|
};
|
|
2371
|
-
setTimeout(
|
|
2366
|
+
setTimeout(clickInput, 20);
|
|
2372
2367
|
};
|
|
2373
2368
|
|
|
2374
2369
|
/**
|