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

feat-600 add context menu for cells #623

Closed

Conversation

gibsonliketheguitar
Copy link
Contributor

#600
Implementation of Context Menu for Row's Cell

ContextMenu Component Wraps DataGrid's Row Component in Table Row Component.
Used a similar structure as the Column Menu, using a single CellMenuRef for the anchor position
Currently copied text is grabbed by calling anchorEl.innerHTML

Problems in the foreseeable feature

  1. Need to think through if we want to integrate with Cmd K Bar for Rowy #598 and other hotkey functions
  2. Selecting the cell column.key is blocking me because the rowRendererProps passed to React Data Grid's Row does not contain column property. We need to figure out how to find the column.key. We can probably do a hacky function with DataGrid's onRow click, but I feel like there has to be a better.

@shamsmosowi
Copy link
Member

Copying inner html is an interesting idea, but it wouldn't work well for complex cells images, color etc.
Have you had a look at the onSelectedCellChange RDG method? could be used to store reference of the cell in jotai state for the menu to use.

@gibsonliketheguitar
Copy link
Contributor Author

@shamsmosowi thanks for lead on, "onSelectedCellChange". It worked like a charm.

Currently implemented copy, paste, and paste from clipboard. We will need to think about which Icon to choose from paste and paste from the clipboard.

A side note. I notice that I could not copy and paste with cmd+x & cmd+v. Can you check if this is occurring on your end too.

@gibsonliketheguitar
Copy link
Contributor Author

#630 New Branch, built on top of develop branch.

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