-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[modal] ESC key capture too aggressive #2544
Comments
so this can't be prevented or overwritten? |
For reference, the current lines are https://github.com/angular-ui/bootstrap/blob/master/src/modal/modal.js#L253-L265 . |
Also, for reference, Twitter Bootstrap has the escape key listener only on the modal element itself rather than on the $document. |
there you go |
Re-looking at this, what's the actual use case where this is breaking things? Why would a user need to type escape while inputting a form? Changing this may break expected behavior (and deviates from Twitter Bootstrap's modal behavior). Typically, if a form control requires the use of the Escape key to perform some action, it should do |
well, when i'm typing something in an input and i press escape (input still |
IMO it would be better if developer explicitly triggered blur on the form elements when they're "empty" so the next |
Hm what kind of an input field is this? I don't think this is the default behavior in browsers. It's not the behavior in the input text boxes in GitHub for example. If a developer triggers |
I realized we can also check whether the event has default prevented to avoid closing the modal if the |
hm - true |
If you could modify your PR or create a new PR for that change, I'll be happy to get it merged 😄 |
ok, so that bugged me for a while...
|
https://github.com/angular-ui/bootstrap/blob/master/src/modal/modal.js#L224-L232
it captures that globally without checking if
event.target
is an user input (<input type="text|number|checkbox|...">
,<textarea>
,<select>
)The text was updated successfully, but these errors were encountered: