Ctrl+clicking a notification closes the notifications menu

AI-generated summary

A discussion about a bug in Discourse where Ctrl+clicking a notification closes the notifications menu. Zecc reported this issue, citing a similar problem with middle-clicking that was recently fixed. tgxworld looked into the issue and fixed it in a GitHub commit.

The fix involved adding a condition to prevent the notifications menu from closing when Ctrl, Cmd, Shift, or middle click is pressed. Zecc questioned the condition, concerned it might break the middle mouse button functionality again. tgxworld clarified the condition and assured it would not cause issues.

Zecc then asked if the fix might affect the right-click context menu, but tgxworld explained that right-clicking does not trigger a click event, citing a Stack Overflow question for reference. The bug is now fixed, as confirmed by tgxworld.

A few days ago the bug where middle-clicking a notification would close the notifications menu was solved. I can no longer find that topic to drop a link to it. No matter.

This is a variation of the same bug: left-clicking a link while holding Ctrl should also open a new background tab and not close the notifications menu.

This is particularly important for touchpad users (yes, there are still a few of us; and no, pressing both touchpad buttons doesn’t always work).

5 Me gusta

I’ll look into the fix for this.

4 Me gusta

Will probably have to cover cmd + click and all other variants of opening in a new tab/window

I’ve thought about what the behaviour should be when opening a new window (shift-clicking), but I’m not so sure about that case since you are opening a new foreground page.

Giving it some more thought, I think for consistency with opening via the context menu I’d leave the notifications menu open in that case also.

Fixed in FIX: Let users open header links in new tab without dismissing dropdown. · discourse/discourse@5be258d · GitHub.

1 me gusta

Why is the condition («modifier held» || e.which === 2)?

Won’t that break the middle mouse button again?

That conditions translates to if ctrl || CMD || shift || middle click is pressed, do not hide the dropdown.

2 Me gusta

Ok. I thought which == 2 was the right button. I should have asked whether this won’t break the context menu then.

:smiley_cat: Context menu?

When you right-click. Won’t that trigger click with e.which === 3 and fail that condition?

I ask without being sure.

1 me gusta

From what I know, right click doesn’t trigger a click event. This might help to explain it.

1 me gusta

This bug has been fixed. :smiley_cat:

4 Me gusta