From d474824b7ce666b0663be5cf348ac5c8cd4ecb6d Mon Sep 17 00:00:00 2001 From: Dan Wahlin Date: Sun, 4 Aug 2013 20:14:12 -0700 Subject: [PATCH] fix(datepicker): correctly manage focus without jQuery present 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 --- src/datepicker/datepicker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index 2b89878a28..68dc7d74d3 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -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); @@ -427,4 +427,4 @@ function ($compile, $parse, $document, $position, dateFilter, datepickerPopupCon }); } }; -}]); \ No newline at end of file +}]);