Pressing return opens a second modal...
Modal service for AngularJS - supports creating popups and modals via a service.
Brought to you by:
evanfcrane
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
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
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.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
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
focusTargetthat useselement.querySelector()to search within the modal would be better. At least, that's what I've manually coded in to my controllers.