问题
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