Skip to content

Commit

Permalink
Remove breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed May 25, 2022
1 parent 9312648 commit eefca15
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/data-editor/use-custom-cells.ts
Expand Up @@ -23,7 +23,7 @@ export type CustomCellRenderer<T extends CustomCell> = {
isMatch: (cell: CustomCell) => cell is T;
draw: (args: DrawArgs, cell: T) => boolean;
provideEditor: ProvideEditorCallback<T>;
onPaste: (val: string, cellData: T["data"]) => T["data"];
onPaste?: (val: string, cellData: T["data"]) => T["data"];
};

export function useCustomCells(
Expand Down Expand Up @@ -68,9 +68,12 @@ export function useCustomCells(

for (const c of cells) {
if (c.isMatch(cell)) {
if (c.onPaste === undefined) {
return undefined;
}
return {
...cell,
data: c.onPaste?.(val, cell.data),
data: c.onPaste(val, cell.data),
};
}
}
Expand Down

0 comments on commit eefca15

Please sign in to comment.