From: Scott González Date: Wed, 8 Feb 2012 18:42:55 +0000 (-0500) Subject: Datepicker: Allow descendant elements in triggers. Fixes #8107 - Closing the datepick... X-Git-Tag: 1.8.18~7 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dc12b4d3109d2b5f611ce2bd8d9caae484cc772b;p=jquery-ui.git Datepicker: Allow descendant elements in triggers. Fixes #8107 - Closing the datepicker via the provided button does not work in Chrome when the button contains other non-text elements. (cherry picked from commit c964894b9b75dc7df62660725967a1f7a526a3ec) --- diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index fbf1f4c45..0b83af289 100644 --- a/ui/jquery.ui.datepicker.js +++ b/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();