jQuery UI Dialog Closes When the Title is Clicked … Sometimes

老子叫甜甜 提交于 2020-01-15 12:47:26

问题


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).

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?


回答1:


Try setting .ui-dialog { position: fixed }



来源:https://stackoverflow.com/questions/24318789/jquery-ui-dialog-closes-when-the-title-is-clicked-sometimes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!