instructure / ic-modal

Ember component for modal dialog
MIT License
62 stars 15 forks source link

Escape after blur should dismiss modal #1

Closed chantastic closed 10 years ago

chantastic commented 10 years ago

I soooo don't mean to be a pain in the ass; if I were smarter I'd make a PR.


It would be nice if pressing escape, after bluring an input, closed the modal:

ryanflorence commented 10 years ago

No such thing as a pita when finding issues :)

I don't know exactly what "Escape, after input is blurred, closes modal" means.

I just did this:

  1. opened the modal
  2. focused a text field
  3. clicked away from the text field, but still in the modal
  4. hit escape
  5. the modal closed

Can you break down the scenario you're talking about? or maybe record a little screencast?

chantastic commented 10 years ago

In our sites, we found that users (that used esc to close modals) expected the modal to "always eventually" be closed with esc.

This case came up a lot:

  1. Open modal
  2. Focus (or get auto-focused) on an input
  3. Escape (first), to blur the input
  4. Escape (second), to close the modal

Here's a video.

ic-modal_esc

For us, this issue may be exacerbated because we auto-focus :input:enabled:visible:first.

ryanflorence commented 10 years ago

How do you get escape to blur an <input type="text">? I can't get my browser to do that.

If I focus the input outside of the modals, esc does nothing (doesn't blur).

When I hit esc with an active input it just closes the modal.

If I do esc in the select box it blurs, and then esc again closes the modal.

If I could reproduce this I'd absolutely fix it.

chantastic commented 10 years ago

Frick!

So sorry to have wasted your time on this, Ryan.

This is on me. I had to reinstall all my Chrome plugins and Vimium didn't have my normal exclude-list.

For shame.