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

Hijack the browser's right-click contextual menu when right-clicking on any part of the items in the FSE / Gutenberg post's blocks hierarchy list view sidebar #40287

Closed
nekohayo opened this issue Apr 13, 2022 · 2 comments · Fixed by #50273
Assignees
Labels
[Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@nekohayo
Copy link

What problem does this address?

With the list view sidebar activated on the left side of the Gutenberg editor, whether for posts/pages or for the FSE, I'm always annoyed when I right-click those items in the list and end up with my browser's (Firefox's) contextual right-click menu full of options irrelevant to my intended action regarding that interactive non-content widget (the list view), which was to get the item-specific actions that Gutenberg offers in its "three dots" menu for that item.

Currently I have the intuitive habit of right-clicking the items anywhere, getting the useless browser menu, having to left-click to dismiss it, then having to left-click the three dots to get the correct menu. I shouldn't have to aim for the tiny three-dots menubutton to get that menu, I should be able to right-click anywhere on that item's row. Fitt's law, etc., for a more efficient and native-feeling/integrated application UX.

What is your proposed solution?

Please hijack the browser's right-click event to show the three-dots contextual menu of Gutenberg actions when clicking on a block item, particularly in the list view sidebar. If Google Drive and GMail can do it, so can WordPress.

Comparison of the current¹ vs suggested behavior when right-clicking anywhere on a row/item in the list view:

wordpress gutenberg FSE suggestion to hijack right-click menus

¹: Tested with the stable versions bundled with WordPress 5.9.3 and the TwentyTwentyTwo theme, on Firefox 99 on Linux.

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Feature] List View Menu item in the top toolbar to select blocks from a list of links. labels Apr 13, 2022
@andrewserong andrewserong self-assigned this May 13, 2022
@andrewserong
Copy link
Contributor

I thought I might have a go at implementing this. I know right-click override behaviour can be a bit contentious for some folks, so in #41041 I've explored implementing this feature plus an editor settings (defaulting to true) so that folks can opt-out of right click overrides if they want to.

@andrewserong
Copy link
Contributor

A new(er) attempt at implementing this is ready for testing over in #50273.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
Status: Done
Status: Done
3 participants