Skip to content

Commit

Permalink
Merge pull request #189 from florisluiten/fix-hide-on-focus-input
Browse files Browse the repository at this point in the history
Focus input field when datepicker is open should not close the datepicker
  • Loading branch information
najlepsiwebdesigner authored Dec 2, 2016
2 parents eb1e5d7 + 3742c8c commit afa0f9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/foundation-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@

}
$(document).on('mousedown', function(e) {
if (that.isInput && e.target === that.element[0]) {
return;
}

// Clicked outside the datepicker, hide it
if ($(e.target).closest('.datepicker.datepicker-inline, .datepicker.datepicker-dropdown').length === 0) {
that.hide();
Expand Down

0 comments on commit afa0f9a

Please sign in to comment.