@linzjs/step-ag-grid 22.2.3 → 22.2.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.
@@ -3585,7 +3585,12 @@ const GridFormDropDown = (props) => {
3585
3585
  (subComponentValue !== undefined && subComponentInitialValue.current !== JSON.stringify(subComponentValue));
3586
3586
  if (hasChanged) {
3587
3587
  if (props.onSelectedItem) {
3588
- await props.onSelectedItem({ selectedRows, value, subComponentValue });
3588
+ await props.onSelectedItem({
3589
+ selectedRows,
3590
+ selectedRowIds: selectedRows.map((row) => row.id),
3591
+ value,
3592
+ subComponentValue,
3593
+ });
3589
3594
  }
3590
3595
  else {
3591
3596
  selectedRows.forEach((row) => (row[field] = value));
@@ -3651,7 +3656,7 @@ const GridFormDropDown = (props) => {
3651
3656
  if (selectedItem === null) {
3652
3657
  if (props.onSelectFilter) {
3653
3658
  const { onSelectFilter } = props;
3654
- await onSelectFilter({ selectedRows, value: filter });
3659
+ await onSelectFilter({ selectedRows, selectedRowIds: selectedRows.map((row) => row.id), value: filter });
3655
3660
  return true;
3656
3661
  }
3657
3662
  else {
@@ -4489,7 +4494,14 @@ const BooleanCellRenderer = (props) => {
4489
4494
  const params = props?.colDef?.cellEditorParams;
4490
4495
  if (!params)
4491
4496
  return;
4492
- const selectedRows = [data];
4497
+ // The data cannot be relied upon if grid changed whilst editing, data will be stale
4498
+ // So I get the data from the node itself which will be up to date.
4499
+ const selectedRows = [];
4500
+ api.forEachNode((n) => {
4501
+ if (n.data.id === data.id) {
4502
+ selectedRows.push(n.data);
4503
+ }
4504
+ });
4493
4505
  const checked = !value;
4494
4506
  onValueChange(checked);
4495
4507
  params.onClick({ selectedRows, selectedRowIds: selectedRows.map((r) => r.id), checked }).then();