mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-21 16:34:21 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -423,4 +423,15 @@ describe('useDataGridBatchActions clipboard paste', () => {
|
||||
expect(editablePreventDefault).not.toHaveBeenCalled();
|
||||
expect(editableHook.setModifiedRows).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('selects a single cell in read-only results without enabling mutation actions', () => {
|
||||
const hook = renderHook({ canModifyData: false });
|
||||
|
||||
selectCell(hook.container, 'row-1', 'id');
|
||||
|
||||
expect(hook.selectionStartRef.current).toEqual({ rowKey: 'row-1', colName: 'id', rowIndex: 0, colIndex: 0 });
|
||||
expect(hook.setSelectedCells).toHaveBeenCalledWith(new Set([makeCellKey('row-1', 'id')]));
|
||||
expect(hook.ctx.markCellSelectionDeleteEligible).toHaveBeenCalledWith(false);
|
||||
expect(hook.updateCellSelection).toHaveBeenCalledWith(new Set([makeCellKey('row-1', 'id')]));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -477,7 +477,7 @@ const handleBatchFillCells = useCallback(() => {
|
||||
const pendingStart = pendingCellSelectionStartRef.current;
|
||||
pendingCellSelectionStartRef.current = null;
|
||||
if (!isDraggingRef.current) {
|
||||
if (pendingStart && canModifyData) {
|
||||
if (pendingStart) {
|
||||
selectSingleCell(pendingStart);
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user