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: Display block settings menu #2990

Closed
swissspidy opened this issue Aug 8, 2019 · 5 comments · Fixed by #3083
Closed

Right-Click: Display block settings menu #2990

swissspidy opened this issue Aug 8, 2019 · 5 comments · Fixed by #3083
Assignees
Labels
Enhancement New feature or improvement of an existing one
Milestone

Comments

@swissspidy
Copy link
Collaborator

Following discovery #2785, let's intercept right-click attempts to display the BlockSettingsMenu. This can be done by filtering editor.BlockEdit to wrap all blocks in a new container where we can add this event listener.

Note: Considerations need to be put into accessibility, making sure that keyboard navigation and focus handling works as expected.

@swissspidy swissspidy added Enhancement New feature or improvement of an existing one AMP Stories labels Aug 8, 2019
@miina miina self-assigned this Aug 21, 2019
@miina
Copy link
Contributor

miina commented Aug 28, 2019

Some thoughts so far after testing this out:

  • Since there can be only one right-click menu open at a time then it seems to make sense to have just one general menu (as opposed to having one per block) which is updated based on the block which was clicked on.
  • It would close when anywhere else is being clicked.
  • Be replaced on each right-click, even if it's the same block, since the position would change depending on the click position.

I guess we would keep the default menu in the Toolbar as well, and add the more relevant buttons to the new menu? We'll probably need a custom component for that anyway since it looks like BlockSettingsMenu can't be added opened by default. Which options should we have in the menu?

  • Remove block;
  • Copy;
  • Cut;
  • Duplicate;

Thoughts?

cc @swissspidy

@swissspidy
Copy link
Collaborator Author

That sounds like a good summary and first step! 👍

@spacedmonkey
Copy link
Contributor

Testing details on #2989 ticket

@csossi
Copy link

csossi commented Sep 13, 2019

Verified in QA

@spacedmonkey
Copy link
Contributor

Screencast can be found here - https://youtu.be/95GjenV63i8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or improvement of an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants