Closed tonyjames3212 closed 7 years ago
Fix it. I modified the code in jquery.datarangepicker.js:
//if user click other place of the webpage, close date range picker window
$(document).bind('click.datepicker', function(evt) {
if (!IsOwnDatePickerClicked(evt, self[0])) {
try{
if (evt.toElement.className!="my-style"){
if (box.is(':visible')) closeDatePicker();
}
}catch(e){
if (box.is(':visible')) closeDatePicker();
}
}
});
and the select added the class:
<select id="testsel" class="my-style">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
Thats it.
@tonyjames3212 so what did you change exactly? Might this be worth a Pull Request?
@holtkamp I just changed it locally for my project.I'm not sure,should I create a branch for this?This plugin itself is good for use.
Well, apparently you changed this section
but you also introduced a specific classname my-style
.
I think when used with a pulldown menu: the DateRangePicker opens when selecting an option from the pulldown, and directly closes again. I guess this is (for now) intended behaviour, so let's leave it at that..
Thanks for the feedback!
jquery version: v2.0.3
When the mouse clicks the button
open
, it works fine. But it works not good withselect
:The datepicker closed immediately after it opend. Any idea?