Application-level keyboard shortcuts should be disabled when a modal is open

When a modal dialog is opened – like the “Invite to topic” dialog – global keyboard shortcuts still fire (unless the input is captured by an input on the modal). This means that you can, for example, inadvertently start composing topics, or perform actions on posts (like “like”, “bookmark”, etc.)

I run into this not infrequently as I keep expecting to be able to invite multiple people to a topic at once – and once I’ve chosen the first person, I start typing the next person’s name, and all sorts of stuff starts happening in the background. :slight_smile:


Are you still experiencing this?

Yep. :slight_smile: Steps to reproduce:

  • Click the “flag” or “invite” button below this topic.
  • Click somewhere on the dialog that isn’t part of the form. (On “invite”, this blurs the input; on “flag”, it’s not as clear, but clicking outside the radio buttons I think blurs the entire form.)
  • Type gl.
  • You’ll be navigated to the “Latest” page in the background, and then the modal will close.

This can be problematic because the “invite” modal looks as though the input accepts multiple people – so if I start typing codingh, then choose @codinghorror from the list, I might start inviting someone else. And if their name starts with an accepting key combination (like Gloria or Glenn or …), I get bumped away.

I’m not suggesting that it should be possible to invite multiple people at once (although perhaps I should suggest that!), but it’d be good to fix this bug so at least things don’t seem to misbehave. :slight_smile: