Open warmwhisky opened 5 years ago
I'm having the same issue @warmwhisky. Did you figure it out how to solve it?
same problem here. Did you find any workaround?
The same, has anybody found a fix of the problem?
I found these guys had the same issue in their docs with there implementation of the clock picker. They have fixed it, but I could not figure out what had been done. mdbootstrap/bootstrap-material-design
I solved it by using an afterShow
function like this:
afterShow: function() {
setTimeout(() => {
$(".collectTime .clockpicker").addClass('picker--opened')
$(".collectTime .clockpicker").show();
}, 50);
}
It's an ugly workaround but solved the issue. I did it before I found the probably related https://github.com/amsul/pickadate.js/issues/1138 which solved the same issue I had with the pickadate.
Same problem here. Weird thing is that works fine if you use secondary mouse button.
The same, Has anyone found a fix the problem?
kaideptrai1102, you can try the renan-teranto's solution, it works but looking not so good :) Anyway it's better than nothing.
I found a solution to this problem, adding one more condition to the if () but clicking on the other side of the modality of the datepicker does not close the datepicker, only if the close button is added
if ( ! event.isSimulated && target != ELEMENT && target != document && event.which != 3 **&& event.which != 1** ) {
// If the target was the holder that covers the screen,
// keep the element focused to maintain tabindex.
P.close( target === P.$holder[0] )
}
By somehow, I added target.classList.contains('pickerholder' ) to the condition if(), so now I can click outside to close datepicker, it's working perfectly fine :) ` if (target.classList.contains('pickerholder') && target != ELEMENT && target != document && event.which !== 3 ) { // If the target was the holder that covers the screen, // keep the element focused to maintain tabindex. P.close( target === P.$root.children()[0] ) } `
For clocktime picker,
You have to find this line 0===i.closest(e.popover.find(".picker__wrap")).length&&0===i.closest(e.input).length&&e.hide()
And replace it to 0===i.closest(e.popover.find(".picker__wrap")).length&&0===i.closest(e.input).length&&i[0].classList.contains('picker__holder')&&e.hide()
This Is Working For Me... $('.datepicker').on('mousedown',function(event){ event.preventDefault(); })
When clicking the input with mousedown, the clock picker pops up but on mouseup it disappears.