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

Add a context menu with a quick option to remove node selections #196

Merged
merged 6 commits into from
Feb 24, 2021

Conversation

JackWilb
Copy link
Member

@JackWilb JackWilb commented Feb 19, 2021

This doesn't close an issue, but it's an improvement that we've wanted for a while. I added a context menu with a button to quickly clear the selection. I also used the composition API style and I feel like I'm becoming more familiar with it.

After reviewing the documentation, I saw there was an @contextmenu event hook so I'm using that. The only lingering issue was if the user held right click it would draw the rect select, so I made sure that only triggers on a left click by checking which button is pressed in the event handler.

This improvement will allow for a couple of improvements requested by Alex, namely #166 and moving some of the menu buttons from the controls to this context menu (like I've done with "Clear Selection")

See #201 for a demo of the functionality

@JackWilb JackWilb requested a review from waxlamp February 19, 2021 19:15
@JackWilb JackWilb merged commit 9fbb48e into master Feb 24, 2021
@JackWilb JackWilb deleted the right-click-menu branch February 24, 2021 16:53
Copy link
Contributor

@waxlamp waxlamp left a comment

Choose a reason for hiding this comment

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

Looks nice and solid, though the use of global state to manage the visibility and position seems like an anti-pattern to me.

src/components/ContextMenu.vue Show resolved Hide resolved
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.

2 participants