I use these frameworks:
I want to use both frameworks to enter a date. My problem is that the date picker is in the background of the alert, and also not usable.
This problem, can you find in this fiddle: https://jsfiddle.net/vbfhtzf9/2/
<button>Click me!</button>
<script>
$(document).ready(function() {
$('button').click(function(){
swal({
html: '<input data-toggle="datepicker" type="text" id="#swal-input1" class="swal2-input">',
confirmButtonText: 'Next →',
showCancelButton: true,
onOpen: function() {
$('[data-toggle="datepicker"]').datepicker({
startView: 2,
autoHide: true,
inline: true,
});
},
});
});
});
</script>
My question is, did you know a CSS, etc... trick, to bring the Datepicker to the front?
I look forward to your answers!
You need to set the z-index inside the datepicker plugin to be a higher number.
onOpen: function() {
$('[data-toggle="datepicker"]').datepicker({
startView: 2,
autoHide: true,
inline: true,
zIndex: 999999
});
},