我用sweetalert2创建了一个模态,输入字段是tempusdominus 的datepicker小部件,但日历显示在模态按钮的后面,如下图所示:
我的代码如下:
Swal.fire({
title: 'Pay',
html: '<input type="text" name="payment_day" class="datetimepicker-input swal2-input" autocomplete="off" data-toggle="datetimepicker" data-target="#payment_day" id="payment_day">',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
onOpen: function () {
$('#payment_day').datetimepicker({
format: 'L'
});
},
}).then((result) => {});