feat: support menuOpenEvent, menuSelectEvent, location for context menu items #8877
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.
The basics
The details
Resolves
Fixes #8844 and fixes #8843
Proposed Changes
Event
and not justPointerEvent
fakeEventForBlock
) while for the comments it comes from the location of the comment. For workspace it is not currently implemented. It needs to be implemented based on the cursor location on the workspace, but since that's a bit in flux I just left it out for now.contextmenu.show
method, if no location is passed, I calculate one based off thePointerEvent
that would have to be passed in if there wasn't a location.Reason for Changes
PointerEvent
.Test Coverage
Manually tested by invoking
showContextMenu
on blocks, workspaces, and comments and made sure the menu opened even when not passed a pointer event, and that the location was expected. Also ensured the events were passed down to the callback correctly.Documentation
Yes, but there's another issue for that.
Additional Information