id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blockedby,blocking
4539,Modal Dialog Opening Offscreen After Scrolling Browser Window,rustyduckpa,,"I am using the following code in the onclick event of an anchor to open a modal dialog:
function addNote(errID) {
$('#addNoteDialog #noteText').text(errID);
$('#addNoteDialog').dialog('open');
}
The code to set up the addNoteDialog is:
$(""#addNoteDialog"").dialog({
bgiframe: true,
autoOpen: false,
height: 300,
title: 'Add Note',
position: 'center',
closeOnEscape: true,
dialogClass: 'dialog',
buttons: {
""Cancel"": function() { $(this).dialog('close'); } ,
""Save"": function() { $(this).dialog('close'); }
},
modal: true
});
If my content is tall and I scroll the browser window to the bottom to reach the link to which my function is attached, "".dialog('open')"" causes the browser window to scroll back to the top, and the modal dialog will open completely offscreen (outside the viewport) near the link. The modal dialog will open correctly in the center of the viewport if I do not have to scroll the browser window. It will sometimes open with the title bar and a sliver of the dialog showing at the bottom of the browser window if I have scrolled the browser window slightly.
Working on Windows XP, IE 7, Firefox 3.0.10.",bug,closed,critical,1.8,ui.dialog,1.7.1,worksforme,,,,