-
Notifications
You must be signed in to change notification settings - Fork 6.7k
fix(modal): skipping ESC handling for form inputs; fixes #2544 #3551
Conversation
This breaks expected behavior as I mentioned in #2544 . Discussing there. |
done |
@@ -251,6 +251,10 @@ angular.module('ui.bootstrap.modal', []) | |||
} | |||
|
|||
$document.bind('keydown', function (evt) { | |||
if (evt.isPropagationStopped() || /^(?:input|textarea|select)$/i.test(evt.target.nodeName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be evt.defaultPrevented
? https://developer.mozilla.org/en-US/docs/Web/API/Event/defaultPrevented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, true!
also, forgot to remove the form input check
on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
went with evt.isDefaultPrevented()
This LGTM, based on the comments in the issue. |
I had to do a few minor tweaks since there have been updates since this PR, but got the tests passing & did some minor cleanup. Thanks! |
🍻 |
also added
scripts
section inpackage.json
to speed up figuring out which task is for testing ;-)