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.

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

Closed
@DanWahlin

Description

@DanWahlin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions