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

Right click action support. #286

Closed
wants to merge 3 commits into from
Closed

Right click action support. #286

wants to merge 3 commits into from

Conversation

sli
Copy link

@sli sli commented Jan 26, 2018

Adds support for right click actions on table rows.

Description

Added an onRowContextMenu prop to the Table component that allows a right click handler to be defined for rows.

Motivation and Context

Applies a PR from the original fixed-data-table. Addresses #33.

How Has This Been Tested?

Not formally tested, but a test implementation was created and is stable. In short, this displays the row index in the console as expected when right clicking in a row:

<Table
  rowHeight={50}
  rowsCount={rows.length}
  width={1000}
  height={1000}
  headerHeight={50}
  onRowContextMenu={(e, rowIndex) => console.log(`Right clicked row #${rowIndex}.`)}
>
  // ... snip ...
</Table>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

@wcjordan
Copy link
Member

Sweet, this looks good to me. Let me try it out this week, and then we can merge it in. If it's not too much work could you add an example demonstrating it's use?

@@ -271,6 +271,13 @@ Callback that is called when a row is double clicked.
type: `func`


### `onRowContextMenu`
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you should add this to api-v0.5
This is only being added to 0.6+ right?

Copy link
Member

Choose a reason for hiding this comment

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

+1 docs are autogenerated, so we don't need to change this file.

@KamranAsif
Copy link
Contributor

LGTM

@difelice
Copy link
Contributor

difelice commented Mar 2, 2018

I created a new PR addressing your comments: #301

@wcjordan
Copy link
Member

wcjordan commented Mar 3, 2018

Closing in favor of #301

@wcjordan wcjordan closed this Mar 3, 2018
@wcjordan
Copy link
Member

wcjordan commented Mar 6, 2018

Released with v0.8.11

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

4 participants