Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Problem when pressing Esc on a datepicker #3096

Closed
jcstritt opened this issue Dec 14, 2014 · 0 comments
Closed

Problem when pressing Esc on a datepicker #3096

jcstritt opened this issue Dec 14, 2014 · 0 comments

Comments

@jcstritt
Copy link

When you have the cursor on the input field of a datepicker, an Esc key press is not propagated to the parent component (a modal box for example), so that the box does not close. When you make the change below on the "scope.keydown" function of this directive, all is ok. For me it's a bug in the two last releases :

      scope.keydown = function(evt) {
        if (evt.which === 27) {
          evt.preventDefault();
          if (scope.isOpen) { // new check here !!!
            evt.stopPropagation();
          }  
          scope.close();
        } else if (evt.which === 40 && !scope.isOpen) {
          scope.isOpen = true;
        }
      }; 
MikeMatusz added a commit to MikeMatusz/bootstrap that referenced this issue Jan 12, 2015
In reference to issue angular-ui#3096
angular-ui#3096
If the escape key should have other functionality in the context of a form (for example, if datepicker is on a modal) it makes sense to prevent this from happening if escape is used to close the dropdown.  If the dropdown is closed, however, the event should be allowed to propagate.
MikeMatusz added a commit to MikeMatusz/bootstrap that referenced this issue Jan 12, 2015
In reference to issue angular-ui#3096
If the escape key should have other functionality in the context of a form (for example, if datepicker is on a modal) it makes sense to prevent this from happening if escape is used to close the dropdown.  If the dropdown is closed, however, the event should be allowed to propagate.
@chrisirhc chrisirhc added this to the 0.13.0 milestone Mar 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants