Scrollbar problem with jQuery UI dialog in Chrome and Safari

前端 未结 9 1398

I\'m using the jQuery UI dialog with modal=true. In Chrome and Safari, this disables scrolling via the scroll bar and cursor keys (scrolling with the mouse whee

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 04:31

    There is a workaround that unbind the binded event. This adds the following in the open: event of the dialog :

    $("#longdialog").dialog({
        modal:true,
        open: function (event, ui) { window.setTimeout(function () {
            jQuery(document).unbind('mousedown.dialog-overlay').unbind('mouseup.dialog-overlay'); }, 100);
        }
    });
    

    This works ... but this is ugly

    --from https://github.com/jquery/jquery-ui/pull/230#issuecomment-3630449

    Worked like a charm in my case.

提交回复
热议问题