Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove onRowsUpdate, enableCellCopyPaste and enableCellDragAndDrop Props #2194

Merged
merged 17 commits into from
Oct 30, 2020

Conversation

amanmahajan7
Copy link
Contributor

@amanmahajan7 amanmahajan7 commented Oct 29, 2020

New Props

onFill?: (event: FillEvent<R>) => R[];
onPaste?: (event: PasteEvent<R>) => R;

export interface FillEvent<TRow> {
  columnKey: string;
  sourceRow: TRow;
  targetRows: TRow[];
}

export interface PasteEvent<TRow> {
  sourceColumnKey: string;
  sourceRow: TRow;
  targetColumnKey: string;
  targetRow: TRow;
}

@amanmahajan7 amanmahajan7 self-assigned this Oct 29, 2020
@amanmahajan7 amanmahajan7 marked this pull request as ready for review October 30, 2020 15:04
Copy link
Contributor

@nstepien nstepien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks almost trivial! 👍

src/DataGrid.tsx Outdated Show resolved Hide resolved
src/DataGrid.tsx Outdated Show resolved Hide resolved
src/DataGrid.tsx Outdated Show resolved Hide resolved
src/DataGrid.tsx Outdated Show resolved Hide resolved
src/EditCell.tsx Show resolved Hide resolved
src/EditCell.tsx Show resolved Hide resolved
stories/demos/AllFeatures.tsx Outdated Show resolved Hide resolved
stories/demos/AllFeatures.tsx Show resolved Hide resolved
amanmahajan7 and others added 5 commits October 30, 2020 11:57
Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
Copy link
Contributor

@nstepien nstepien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can also remove the enableCellCopyPaste and enableCellDragAndDrop props.

@amanmahajan7
Copy link
Contributor Author

I think it makes sense to have these props. There are many cases when we need to disable copy/paste and fill operations.

@nstepien
Copy link
Contributor

In that case the handler can be set to undefined

  onFill={enabled ? handleFill : undefined}

@amanmahajan7 amanmahajan7 changed the title Remove onRowsUpdate Remove onRowsUpdate, enableCellCopyPaste and enableCellDragAndDrop Props Oct 30, 2020
@amanmahajan7 amanmahajan7 merged commit a6fe544 into canary Oct 30, 2020
@amanmahajan7 amanmahajan7 deleted the am-remove-onrowsupdate branch October 30, 2020 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants