Menu

#183 Pressing return opens a second modal...

open
nobody
None
2017-02-09
2016-11-05
Anonymous
No

Originally created by: mikeerickson

Using sample (Yes No) if I press return, instead of closing the dialog (as one would expect triggering blue yes), instead it creates another modal (and the background fade darkens)

Repeating this process continues to open another modal, and background darkens

Discussion

  • Anonymous

    Anonymous - 2016-11-10

    Originally posted by: ofirgeller

    The focus stays on the button after you click it, pressing return/enter then clicks the button again.
    the service moving the focus to the newly created modal seems like a sane default to me that will fix this problem.

     
  • Anonymous

    Anonymous - 2017-02-09

    Originally posted by: elliottregan

    Focusing on the newly created modal is a dangerous default. In some browsers, if the element receiving focus isn't focusable (tabindex>=0, <input>, etc.), then the focus goes to the <body>. If the developer wants to focus to go directly to a particular element, this would need to be coded around.

    an optional focusTarget that uses element.querySelector() to search within the modal would be better. At least, that's what I've manually coded in to my controllers.

     

Log in to post a comment.