# Ctrl+clicking a notification closes the notifications menu

**URL:** <https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463>\
**Category:** Bug\
**Created:** [27 Luglio 2015, 8:17am UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463 "2015-07-27T08:17:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zecc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zecc/32/39548_2.png) [@Zecc](https://meta.discourse.org/u/Zecc)\
**Post date:** [27 Luglio 2015, 8:17am UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/1 "2015-07-27T08:17:27Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [27 Luglio 2015, 8:36am UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/2 "2015-07-27T08:36:11Z")

</div>

I’ll look into the fix for this.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [27 Luglio 2015, 9:07am UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/3 "2015-07-27T09:07:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Zecc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zecc/32/39548_2.png) [@Zecc](https://meta.discourse.org/u/Zecc)\
**Post date:** [27 Luglio 2015, 9:13am UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/4 "2015-07-27T09:13:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [27 Luglio 2015, 2:21pm UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/5 "2015-07-27T14:21:56Z")

</div>

Fixed in [FIX: Let users open header links in new tab without dismissing dropdown. · discourse/discourse@5be258d · GitHub](https://github.com/discourse/discourse/commit/5be258ded4cc201d80383b7b9a574f8e922a4a42).

---

<div class="post-metadata">

**Author:** ![Zecc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zecc/32/39548_2.png) [@Zecc](https://meta.discourse.org/u/Zecc)\
**Post date:** [27 Luglio 2015, 2:29pm UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/6 "2015-07-27T14:29:44Z")

</div>

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

Won’t that break the middle mouse button again?

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [27 Luglio 2015, 3:02pm UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/7 "2015-07-27T15:02:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Zecc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zecc/32/39548_2.png) [@Zecc](https://meta.discourse.org/u/Zecc)\
**Post date:** [27 Luglio 2015, 3:12pm UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/8 "2015-07-27T15:12:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [27 Luglio 2015, 3:14pm UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/9 "2015-07-27T15:14:03Z")

</div>

😺 Context menu?

---

<div class="post-metadata">

**Author:** ![Zecc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zecc/32/39548_2.png) [@Zecc](https://meta.discourse.org/u/Zecc)\
**Post date:** [27 Luglio 2015, 3:15pm UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/10 "2015-07-27T15:15:48Z")

</div>

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

I ask without being sure.

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [28 Luglio 2015, 5:23am UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/11 "2015-07-28T05:23:08Z")

</div>

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

> <https://stackoverflow.com/questions/7343117/cant-use-jquerys-click-event-handler-to-detect-right-click>

---

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [29 Luglio 2015, 2:43am UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/12 "2015-07-29T02:43:26Z")

</div>

This bug has been fixed. 😺

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [29 Luglio 2015, 2:46am UTC](https://meta.discourse.org/t/ctrl-clicking-a-notification-closes-the-notifications-menu/31463/13 "2015-07-29T02:46:00Z")

</div>


