Fixed selection reset on loading more (#3500)
This commit is contained in:
@ -2,7 +2,6 @@ import { useRecoilCallback } from 'recoil';
|
|||||||
|
|
||||||
import { entityFieldsFamilyState } from '@/object-record/field/states/entityFieldsFamilyState';
|
import { entityFieldsFamilyState } from '@/object-record/field/states/entityFieldsFamilyState';
|
||||||
import { useRecordTableStates } from '@/object-record/record-table/hooks/internal/useRecordTableStates';
|
import { useRecordTableStates } from '@/object-record/record-table/hooks/internal/useRecordTableStates';
|
||||||
import { useResetTableRowSelection } from '@/object-record/record-table/hooks/internal/useResetTableRowSelection';
|
|
||||||
import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';
|
import { getSnapshotValue } from '@/ui/utilities/recoil-scope/utils/getSnapshotValue';
|
||||||
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
import { isDeeplyEqual } from '~/utils/isDeeplyEqual';
|
||||||
|
|
||||||
@ -15,8 +14,6 @@ export const useSetRecordTableData = ({
|
|||||||
recordTableId,
|
recordTableId,
|
||||||
onEntityCountChange,
|
onEntityCountChange,
|
||||||
}: useSetRecordTableDataProps) => {
|
}: useSetRecordTableDataProps) => {
|
||||||
const resetTableRowSelection = useResetTableRowSelection(recordTableId);
|
|
||||||
|
|
||||||
const { getTableRowIdsState, getNumberOfTableRowsState } =
|
const { getTableRowIdsState, getNumberOfTableRowsState } =
|
||||||
useRecordTableStates(recordTableId);
|
useRecordTableStates(recordTableId);
|
||||||
|
|
||||||
@ -41,16 +38,9 @@ export const useSetRecordTableData = ({
|
|||||||
set(getTableRowIdsState(), entityIds);
|
set(getTableRowIdsState(), entityIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
resetTableRowSelection();
|
|
||||||
|
|
||||||
set(getNumberOfTableRowsState(), entityIds.length);
|
set(getNumberOfTableRowsState(), entityIds.length);
|
||||||
onEntityCountChange(entityIds.length);
|
onEntityCountChange(entityIds.length);
|
||||||
},
|
},
|
||||||
[
|
[getNumberOfTableRowsState, getTableRowIdsState, onEntityCountChange],
|
||||||
getNumberOfTableRowsState,
|
|
||||||
getTableRowIdsState,
|
|
||||||
onEntityCountChange,
|
|
||||||
resetTableRowSelection,
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user