diff --git a/packages/core/src/data-editor-all.tsx b/packages/core/src/data-editor-all.tsx index 8cdd822c5..11ca5848c 100644 --- a/packages/core/src/data-editor-all.tsx +++ b/packages/core/src/data-editor-all.tsx @@ -5,7 +5,7 @@ import { sprites } from "./internal/data-grid/sprites.js"; import ImageWindowLoaderImpl from "./common/image-window-loader.js"; import type { ImageWindowLoader } from "./internal/data-grid/image-window-loader-interface.js"; -export interface DataEditorAllProps extends Omit { +export interface DataEditorAllProps extends Omit { imageWindowLoader?: ImageWindowLoader; } @@ -14,6 +14,10 @@ const DataEditorAllImpl: React.ForwardRefRenderFunction { + return p.renderers ?? AllCellRenderers; + }, [p.renderers]) + const imageWindowLoader = React.useMemo(() => { return p.imageWindowLoader ?? new ImageWindowLoaderImpl(); }, [p.imageWindowLoader]); @@ -21,7 +25,7 @@ const DataEditorAllImpl: React.ForwardRefRenderFunction { expect(onClickSpy).not.toBeCalled(); }); + test("renderers can override internal cells", async () => { + const spy = vi.fn(); + + vi.useFakeTimers(); + render( + , + ]} + rowMarkers="both" + />, + { + wrapper: Context, + } + ); + prep(); + expect(spy).toHaveBeenCalledTimes(31); // Math.ceil((height - headerHeight) / rowHeight) + }); + test("onCellsEdited blocks onCellEdited", async () => { const spy = vi.fn(); vi.useFakeTimers();