@linzjs/step-ag-grid 22.2.0 → 22.2.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/dist/src/components/clickInputWhenContainingCellClicked.d.ts +1 -1
- package/dist/step-ag-grid.cjs.js +8 -14
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +8 -14
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/clickInputWhenContainingCellClicked.tsx +12 -15
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -2337,38 +2337,32 @@ 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;
|
|
2343
2344
|
const element = event.target;
|
|
2344
2345
|
// Already handled
|
|
2345
|
-
if (
|
|
2346
|
+
if (element.closest(".GridCell-readonly") ||
|
|
2347
|
+
(["BUTTON", "INPUT"].includes(element?.tagName) && element.closest(".ag-cell-inline-editing"))) {
|
|
2346
2348
|
return;
|
|
2349
|
+
}
|
|
2347
2350
|
const row = element.closest("[row-id]");
|
|
2348
2351
|
if (!row)
|
|
2349
2352
|
return;
|
|
2350
2353
|
const colId = colDef.colId;
|
|
2351
2354
|
if (!colId)
|
|
2352
2355
|
return;
|
|
2353
|
-
const clickInput = (
|
|
2356
|
+
const clickInput = () => {
|
|
2354
2357
|
const cell = row.querySelector(`[col-id='${colId}']`);
|
|
2355
2358
|
if (!cell)
|
|
2356
2359
|
return;
|
|
2357
2360
|
const input = cell.querySelector("input, button");
|
|
2358
|
-
if (!input)
|
|
2361
|
+
if (!input)
|
|
2359
2362
|
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
|
-
}
|
|
2367
|
-
return;
|
|
2368
|
-
}
|
|
2369
2363
|
input?.dispatchEvent(event);
|
|
2370
2364
|
};
|
|
2371
|
-
setTimeout(
|
|
2365
|
+
setTimeout(clickInput, 20);
|
|
2372
2366
|
};
|
|
2373
2367
|
|
|
2374
2368
|
/**
|