Merged
Conversation
Contributor
Author
shamsmosowi
reviewed
Feb 2, 2022
| const selectedColIndex = selectedCell?.colIndex; | ||
| const selectedCol = _find(tableState?.columns, { index: selectedColIndex }); | ||
| const getActions = | ||
| getFieldProp("contextMenuActions", selectedCol?.type) || |
Contributor
There was a problem hiding this comment.
add support for derivatives
notsidney
approved these changes
Feb 2, 2022
Contributor
notsidney
left a comment
There was a problem hiding this comment.
I’ll make the small changes I mentioned in the comments, no need to do anything
Comment on lines
+12
to
+35
| <ContextMenu> | ||
| <Row {...props} /> | ||
| </ContextMenu> | ||
| </Fragment> | ||
| ); | ||
|
|
||
| return <Row {...props} />; | ||
| return ( | ||
| <ContextMenu> | ||
| <Row {...props} /> | ||
| </ContextMenu> | ||
| ); | ||
| } | ||
|
|
||
| const ContextMenu = (props: any) => { | ||
| const { contextMenuRef }: any = useProjectContext(); | ||
| function handleClick(e: any) { | ||
| e.preventDefault(); | ||
| const input = e?.target as HTMLElement; | ||
| if (contextMenuRef?.current) { | ||
| contextMenuRef?.current?.setAnchorEl(input); | ||
| } | ||
| } | ||
| return <span onContextMenu={(e) => handleClick(e)}>{props.children}</span>; | ||
| }; |
Contributor
There was a problem hiding this comment.
I don’t think ContextMenu needs to be a separate component. I just set the onContextMenu prop on Row and the e.target is the cell div, which is the same in both methods.
Contributor
Author
There was a problem hiding this comment.
Good catch, my dude! The less code the better. I will update the changes
notsidney
added a commit
that referenced
this pull request
Feb 2, 2022
notsidney
added a commit
that referenced
this pull request
Feb 2, 2022
notsidney
added a commit
that referenced
this pull request
Feb 2, 2022
notsidney
added a commit
that referenced
this pull request
Feb 2, 2022
Merged
notsidney
added a commit
that referenced
this pull request
Feb 4, 2022
* develop: (39 commits) ammend changes split jotai atom into selectedCell and anchorEle atom amend requested changes create table useBasicSearch: switch to match-sorter ammend fix recommendations remove contextMenuRef and replace with jotai fix issue requested in pr remove unused dependencies fix ContextMenu close animation (#630) use mui cut, paste icons (#630) comment out console.logs (#630) TableRow: remove unnecessary wrapping component ContextMenu (#630) fix add column to left/right showing stale data in new column settings enable context menu on all string field and only number field fix remove bug add context menu feature with cut, copy, and paste add cut and paste icons fix filters override clear button copy clean up status number logic ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#600
Enable Right click on designated Field Types