Item context menu appears instead of section menu or column header menu

Hi! Weird bug I've been having for a few days now. Zotero is up-to-date (7.0.9), Mac is up-to-date (15.2), did a fresh installation of Zotero and tried this on a new profile:

Whenever I right-click on an item, library, collection, the appropriate context menu appears, in the appropriate place. However, when I right-click on the item tree's column headers (i.e., to add a column), or on a section icon (to pin it, for instance), the last context menu appears (in its original location) instead of the column/section menu. For instance:
- Right-click on item
- Item menu shows below item
- Right click on section icon
- Item menu shows below item (again)
- Right-click on library
- Library menu shows below library
- Right-click on column header
- Library menu shows below library (again)

This means that I've been unable to change my column headers or pin sections... Any idea as to the cause?
  • So it seems that this commit explains part of it: https://github.com/zotero/zotero/commit/8e87aa15e73ad05c32a22b00c9ab500fb8c4ce46

    Sort options are now part of the View main menu. Makes sense, but it's a bit unexpected to right-click the columns (as I think was how it was done in the past) and see an unrelated popup appear). However, I haven't found the reason why the section pin/unpin context menu doesn't appear.
  • I'm not seeing this. Can you provide a screenshot and a Report ID? Does this happen in Troubleshooting Mode (Help → "Restart in Troubleshooting Mode…”)?
  • Here's a screen recording in Troubleshooting mode: https://share.cleanshot.com/qcFDbTTw

    And the corresponding reports: D917971095, 2077675019
  • Oh, relevant discovery: this only happens when I "two finger click" on the trackpad, not when I ctrl+click. Also, when using ctrl+click, the menu appears more quickly and exactly at the click location, whereas when I "two finger click", it appears achored to the element.
  • Oh, this is on the macOS 15.2 beta? Can you reproduce this on a 15.1 machine?
  • I suspect the relevant commit here is https://github.com/zotero/zotero/commit/23f9ebcd17b773b7389171ea9c2b1332288d9b01 and that 15.2 is causing this code to be triggered for you for a two-finger click. We'll try to test on the 15.2 beta.
  • I updated to the 15.2 beta yesterday directly from the 15.1 beta and I’m 99% sure I’ve been having this issue for at least a week now so it might still happen on 15.1 too. I currently don’t have access to a 15.1 machine anymore so I can’t confirm. However, I’ll look into the code and see if something changed between 15.1 and 15.2.
  • edited 14 days ago
    It's not a general problem on 15.1. But the anchoring behavior you're seeing is very likely from the commit I linked to, which was added in 7.0.8 on October 18.

    It shouldn't really matter, but is this a MacBook or a Magic Trackpad?
  • MacBook. I've tested it out a bit more and Ctrl+clicking is exactly the behaviour I expect: snappy, context menu also for section icons _and_ column headers. However, I assume most people on a MacBook (or using a Mac with any trackpad for that matter) primarily use the two-finger method for context menus. Do you have a source for this "new system menu" behaviour in Sequoia? Because I tried with Ctrl+Enter and indeed, that's the menu that appears and there's no way to tab-select the section icons.
  • Are you running any third-party software that might affect the trackpad?

    Note that it's probably not the "last" context menu that's appearing — it's just triggering the context menu on the selected tree row. If you just left-click a collection or item and then two-finger tap on something else, you'll likely see the same behavior.
  • Indeed, it's not the last menu, but the one corresponding to the focussed item. In short, in Zotero at least, secondary clicks triggered with two fingers are captured as the "Ctrl+Enter" system-wide shortcut, whereas Ctrl+clicking triggers the contextmenu event on the target. I tried this in Safari, Firefox and Mail, and all apps correctly distinguish the two: a two-finger secondary click or a ctrl+click have the same behavior (context menu at the mouse position) and ctrl+enter pulls up the context menu for the focussed item. I don't have any third-party keyboard or mouse software, so I'm guessing this is specific to Zotero.

    I think the issue stems from this line: https://github.com/zotero/zotero/commit/23f9ebcd17b773b7389171ea9c2b1332288d9b01#diff-0ec361a3df0e76da5d502b97d1a3e1a08f19332ae39197b7deb23cce0512d77fR51

    The code captures all contextmenu events, except those that match (NOT secondaryButton OR NOT buttons=0 OR ctrlKey pressed). In other words, it only considers secondary clicks that are triggered with Ctrl. For reference, here are the MouseEvent properties I was able to log in Safari:

    - Two-finger click: contextmenu which=3 button=2 buttons=0 ctrlKey=false
    - Ctrl+click: contextmenu which=1 button=0 buttons=1 (but also sometimes 0??) ctrlKey=true
    - Ctrl+Enter shortcut: contextmenu which=3 button=2 buttons=0 ctrlKey=false (!)

    As you can see, a Ctrl+Enter context menu triggers the exact same "signature" as the two finger click. The only difference is that clientX/Y are both set to 1 in my testing when using Ctrl+Enter...

    TL/DR; assuming the whole event retarget is necessary (haven't tested it before 7.0.8), the logic test that excludes events from this retarget should not only filter out ctrl+click events but also regular secondary clicks (which is what the two finger click does here).
  • I see this on a MacBook Pro trackpad using Sequoia 15.1.

    I only see it if I two-finger tap, not two-finger click.

    Two-finger tap is supposed to bring up options/context menus for *selected* items (as far as I understand), so while this is a bit unexpected and annoying, I am not sure if it is entirely the wrong behavior.
  • edited 12 days ago
    Oh, two-finger tap, not click. (@thebluepotato said "two finger click", and I forgot that you can do a two-finger tap when "Tap to click" is enabled.) I can reproduce with a two-finger tap. Thanks @enozkan for clarifying.

    But yes, the behavior is wrong — you can see in, say, Finder that a two-finger tap behaves the same as a two-finger click and shows the context menu at the cursor position, not for the selected file.

    In any case, we've already fixed this for the next beta (because I accidentally wrote down "tap" when creating a ticket and another developer reproduced it).
  • Sorry for the lack of clarity, I never ever ever « click » on my trackpad, just tappity tap tap. Glad it’ll be fixed and thanks for investigating!
  • This is fixed in the latest beta.
  • Works perfectly now! Issue resolved
Sign In or Register to comment.