Z-index 不适用于 datetimepicker django 小部件

Z-index does not work with datetimepicker django widgets

我使用了 this 日期时间选择器。

我发现 z-index 不起作用,日期时间弹出窗口隐藏在 div.

我发现问题是由于 class "table-responsive".

这是我的代码:

<form>
<div class="table-responsive">
    <table class="table">
        <tr>
            <td>
                <!-- my datetimepicker fields  -->
            </td>
        </tr>
    </table>
  </div>
</form>

我试过这个 jquery 代码:

$(document).on('focusin','#'+inputId,function (){console.log($(this).parentsUntil('div.table-responsive').last());$(this).parentsUntil('div.table-responsive').last().parent().css('overflow-x','visible') });
    $(document).on('focusout','#'+inputId,function (){$(this).parentsUntil('div.table-responsive').last().parent().css('overflow-x','scroll') });
    

如果没有 x 溢出,这将解决问题。 如果存在 x 溢出,则日期输入因溢出而被隐藏。

我用 this 个文件替换了 date piker js 文件,问题就解决了。