Permalink
Browse files

Datepicker: Allow descendant elements in triggers. Fixes #8107 - Clos…

…ing the datepicker via the provided button does not work in Chrome when the button contains other non-text elements.

(cherry picked from commit c964894)
  • Loading branch information...
1 parent 28fb436 commit dc12b4d3109d2b5f611ce2bd8d9caae484cc772b @scottgonzalez scottgonzalez committed Feb 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 ui/jquery.ui.datepicker.js
@@ -845,7 +845,7 @@ $.extend(Datepicker.prototype, {
if ( ( ( $target[0].id != $.datepicker._mainDivId &&
$target.parents('#' + $.datepicker._mainDivId).length == 0 &&
!$target.hasClass($.datepicker.markerClassName) &&
- !$target.hasClass($.datepicker._triggerClass) &&
+ !$target.closest("." + $.datepicker._triggerClass).length &&
$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) )
$.datepicker._hideDatepicker();

0 comments on commit dc12b4d

Please sign in to comment.