单击标题时,jQuery UI对话框关闭...有时

单击标题时,jQuery UI对话框关闭...有时

问题描述:

我有一个带有一些奇怪行为的jQuery UI对话框:每当单击或双击对话框的标题/标题时,都有可能在不删除模式覆盖的情况下关闭对话框(双击似乎比点击更容易触发它,但是两者都相当频繁,而且都没有一次触发接近100%的时间.

I have a jQuery UI Dialog with some strange behavior: whenever you click or double-click on the header/title of the dialog, there is a chance that it will close the dialog, without removing the modal overlay (double-clicks seem to trigger it more often than clicks, but both are pretty frequent and neither one triggers a close 100% of the time).

模态遗留下来的事实使我认为正在发生错误,但是控制台中没有错误.我很想怪我的代码,但是即使我初始化对话框时根本没有任何选项($el.dialog({})),也会发生这种现象.我也尝试将{close: $.noop}设置为无效.但是,我们代码库中其他地方的其他对话框都没有这种行为(即使我在CSS中找不到它们之间的任何有意义的区别).

The fact that the modal is left behind makes me think that an error is happening, but there's no errors in the console. I'd be tempted to blame my code, but this behavior happens even when I initialize the dialog with no options at all ($el.dialog({})). I've also tried setting {close: $.noop}, to no avail. However other dialogs elsewhere in our codebase don't have this behavior (even though I can't find any meaningful differences between them except in the CSS).

有人知道发生了什么吗,我该如何纠正?

Does anyone have any idea what's going on, and how I can correct it?

尝试设置 .ui-dialog { 位置:固定 }

Try setting .ui-dialog { position: fixed }