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

Bug with focus() in DatePicker w/out jQuery #758

Closed
DanWahlin opened this issue Aug 5, 2013 · 0 comments
Closed

Bug with focus() in DatePicker w/out jQuery #758

DanWahlin opened this issue Aug 5, 2013 · 0 comments

Comments

@DanWahlin
Copy link
Contributor

I've been using the DatePicker and found a bug in the following area (works when jQuery is present but I'm trying to eliminate jQuery for this particular app). It's currently line 394 that has the problem in the source.

  scope.$watch('isOpen', function(value) {
    if (value) {
      updatePosition();
      $document.bind('click', documentClickBind);
      element.unbind('focus', elementFocusBind);
      element.focus();
    } else {
      $document.unbind('click', documentClickBind);
      element.bind('focus', elementFocusBind);
    }

    if ( setIsOpen ) {
      setIsOpen(originalScope, value);
    }
  });

The element.focus() will throw an error since the object needs to be unwrapped first. Should be: element[0].focus() at a minimum to unwrap the jqlite object since it doesn't expose focus().

I submitted a patch but wanted to pass along the info in case anyone else runs into this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant