Skip to content

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

Description

@nekohayo

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.

Activity

  1. added
    [Type] Enhancement
    [Feature] List View
    on Apr 13, 2022
  2. self-assigned this
    on May 13, 2022
  3. andrewserong commented on May 13, 2022

    @andrewserong
    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.

  4. added
    [Status] In Progress
    on May 13, 2022
  5. moved this to Needs Dev / Todo in WordPress 6.4 Editor Taskson Aug 30, 2023
  6. moved this from Needs Dev / Todo to In Progress in WordPress 6.4 Editor Taskson Sep 1, 2023
  7. andrewserong commented on Sep 14, 2023

    @andrewserong
    Contributor

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

  8. moved this from In Progress to Punted to 6.5 in WordPress 6.4 Editor Taskson Sep 25, 2023
  9. moved this from ❓ Triage to 🏗️ In Progress in WordPress 6.5 Editor Taskson Nov 23, 2023
  10. moved this from 🏗️ In Progress to ✅ Done in WordPress 6.5 Editor Taskson Dec 14, 2023
  11. BenceSzalai commented on Dec 9, 2024

    @BenceSzalai

    Is there a reason this was not added to the main editor canvas, just the List View?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Feature] List View[Status] In Progress[Type] Enhancement

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions