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

Problem when pressing Esc on a datepicker  #3096

@jcstritt

Description

@jcstritt

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;
        }
      }; 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions