Keyboard Shortcuts popup dismissal doesn't

(Mr.Burns avatar therefor TDWTF) #1

Originally noticed here but reproduced on meta.

Click the menu hamburger/three line thingy and then look at the keyboard shortcuts.

Then click the darkened area outside the pop up explaining the short cuts. You would expect it to go away, but instead the menu you clicked to see the keyboard shortcuts goes away.

(TechnoBear) #2

Clicking the darkened area doesn’t dismiss the pop-up even if you open it directly via the keyboard shortcut ?.

I may just be peculiar (I prefer keyboard to mouse where possible), but I would only expect to close the pop-up by clicking the surrounding area if there were no other obvious method of closing it. In this case, it has an “X” to dismiss it, which does work, as does Esc.

(Mr.Burns avatar therefor TDWTF) #3

The fact that the dismissal happens on the under menu is what struck me when it was pointed out on a different instance (linked). Just seems like odd behavior that may mean how events are bubbling is wonky.

(Gerhard Schlager) #4

Clicking on the screenshot above also opens a lightbox which shows the “X” to dismiss it. However, it can also be closed by clicking the gray area outside of the screenshot. And to be honest, most of the time that’s how I close such pop-ups.

(Mr.Burns avatar therefor TDWTF) #5

Those are a different setup from the keyboard shortcut one though. On an image lightbox your cursor is the negative magnifying glass when in the gray area (which doesn’t make a lot of sense but whatever) and it is not when doing the keyboard shortcut one.

(Zane Beckman) #6

I’m noticing two things here.

  1. The hamburger menu doesn’t dismiss when you click “keyboard shortcuts” the first time. It makes most sense to me that it would dismiss immediately upon clicking “keyboard shortcuts.”
  2. Clicking in the dark area outside the keyboard shortcuts popup doesn’t dismiss the shortcuts. Whether or not it functions identically to lightboxes, I feel, is irrelevant. Expected behavior is that it would dismiss when clicking on the darker area.

(I also agree that the negative magnifying glass with lightboxes doesn’t make sense.)

(Robin Ward) #7

Definitely should be fixed.


Unwrapping your targets using the X inside the container is easy. The one outside is not because it is part of the wrapper (divs and CSS) that you generate on the fly.

You could disable the outside container click function, but users will get audible about their expectations.

So then that leaves you with a problem of clicking self-wrapper to destroy ‘self’ with no understanding of where it is at (how to get out).

Lol…That last part sounds like the summation of my last marriage.

(Robin Ward) #9

This is not the first time clicking on the background has regressed so I added some integration test when I fixed it this time:


You’re testing looks good. Just out of curiosity do you have a logging system that barks at you when tests fail? I assume yes but is it built in to discourse or something third party?

(sorry for the general programming question my programming environment is vastly different…very ad-hoc (since it is just me behind the scenes)).

(Kane York) #11

Yes - if the tests fail, the tests-passed branch on Github will not be updated.


I see…I’ll need to take a look over there and browse some of your testing code. Trying to do the same over here but I don’t understand how I create tests (MXUnit is the tool that is recommended for my environment), so maybe I can learn by looking at the discourse repo (get some ideas on how to start/approach).

Thanks Riking!

(Jeff Atwood) #13