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

Commit

Permalink
fix(datepicker): correctly manage focus without jQuery present
Browse files Browse the repository at this point in the history
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().

Closes #758
  • Loading branch information
DanWahlin authored and pkozlowski-opensource committed Aug 5, 2013
1 parent f6aa26b commit d474824
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
updatePosition();
$document.bind('click', documentClickBind);
element.unbind('focus', elementFocusBind);
element.focus();
element[0].focus();
} else {
$document.unbind('click', documentClickBind);
element.bind('focus', elementFocusBind);
Expand Down Expand Up @@ -427,4 +427,4 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon
});
}
};
}]);
}]);

0 comments on commit d474824

Please sign in to comment.