@linzjs/step-ag-grid 22.2.2 → 22.2.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.
@@ -4476,7 +4476,11 @@ const BooleanCellRenderer = (props) => {
4476
4476
  api.removeEventListener("cellFocused", checkFocus);
4477
4477
  };
4478
4478
  }, [api, column, node.rowIndex]);
4479
- return (jsx("div", { className: clsx("ag-wrapper ag-input-wrapper ag-checkbox-input-wrapper", { "ag-checked": props.value }), children: jsx("input", { type: "checkbox", className: "ag-input-field-input ag-checkbox-input", disabled: !fnOrVar(colDef?.editable, props), ref: inputRef, checked: value, onChange: () => { }, onClick: (e) => {
4479
+ const isDisabled = !fnOrVar(colDef?.editable, props);
4480
+ return (jsx("div", { className: clsx("ag-wrapper ag-input-wrapper ag-checkbox-input-wrapper", {
4481
+ "ag-checked": props.value,
4482
+ "ag-disabled": isDisabled,
4483
+ }), children: jsx("input", { type: "checkbox", className: "ag-input-field-input ag-checkbox-input", disabled: isDisabled, ref: inputRef, checked: value, onChange: () => { }, onClick: (e) => {
4480
4484
  e.stopPropagation();
4481
4485
  // cell has to be in edit mode
4482
4486
  // if in non-edit mode clickInputWhenContainingCellClicked will click to put it in edit mode
@@ -4485,7 +4489,14 @@ const BooleanCellRenderer = (props) => {
4485
4489
  const params = props?.colDef?.cellEditorParams;
4486
4490
  if (!params)
4487
4491
  return;
4488
- const selectedRows = [data];
4492
+ // The data cannot be relied upon if grid changed whilst editing, data will be stale
4493
+ // So I get the data from the node itself which will be up to date.
4494
+ const selectedRows = [];
4495
+ api.forEachNode((n) => {
4496
+ if (n.data.id === data.id) {
4497
+ selectedRows.push(n.data);
4498
+ }
4499
+ });
4489
4500
  const checked = !value;
4490
4501
  onValueChange(checked);
4491
4502
  params.onClick({ selectedRows, selectedRowIds: selectedRows.map((r) => r.id), checked }).then();