Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#8741 closed bug (fixed)

Dialog: dialog with position:fixed goes offscreen when opening after scrolling down since v 1.9.0

Reported by: Valentin Plamadeala Owned by:
Priority: minor Milestone: 1.9.2
Component: ui.dialog Version: 1.9.1
Keywords: regression Cc:
Blocked by: Blocking:

Description

this the jsfidlle link to see it ( if you have big screen make it smaller, you have to have scrollbars, so you would scroll down to the button that opens the dialog)

open with Chrome or IE9 (with Mozilla works ok) http://jsfiddle.net/yQkGu/

Note that if you change to version 1.8.24 it will work ok

Change History (13)

comment:1 Changed 7 years ago by Valentin Plamadeala

I found a fix for this:

div.dialog({
...
                dialogClass: myfixedPopup
                //  position: 'center', //setting here won't help
            });

//setting position to center this way after dialog was already defined helps 
div.dialog("option", "position", 'center');
Last edited 7 years ago by Valentin Plamadeala (previous) (diff)

comment:2 Changed 7 years ago by tj.vantoll

Status: newopen

Cleaned up the fiddle - http://jsfiddle.net/tj_vantoll/LZ9SR/. I can definitely see a difference between 1.8.24 & 1.9.1 but I can't put my finger on exactly what's going on.

comment:3 Changed 7 years ago by tj.vantoll

Summary: jQueryUI dialog with position:fixed goes offscreen when opening after scrolling down since v 1.9.0Dialog: dialog with position:fixed goes offscreen when opening after scrolling down since v 1.9.0

comment:4 Changed 7 years ago by Jörn Zaefferer

What's the motivation for setting position:fixed on the dialog?

comment:5 Changed 7 years ago by Scott González

Forced visibility, it's a very common request.

comment:6 Changed 7 years ago by Scott González

Keywords: regression added

comment:7 Changed 7 years ago by Valentin Plamadeala

position:fixed makes the dialog to be position relative to the browser window instead of the page, for me it doesn't make sense to show a popup and scroll down/up and loose it, especially for modal dialogs

comment:8 Changed 7 years ago by Scott González

This is caused by http://bugs.jquery.com/ticket/11671

There are two ways to fix this: Use jquery-git :-P or set top: 0; left: 0; in your styles to avoid the bug.

comment:9 Changed 7 years ago by Scott González

Resolution: fixed
Status: openclosed

Dialog: Set top and left properties in the default styles to avoid a bug in core. Fixes #8741 - Dialog: dialog with position:fixed goes offscreen when opening after scrolling down since v 1.9.0.

Changeset: 59865715fbec0462a0cc872195b44d3e3704a24b

comment:10 Changed 7 years ago by Scott González

Dialog: Set top and left properties in the default styles to avoid a bug in core. Fixes #8741 - Dialog: dialog with position:fixed goes offscreen when opening after scrolling down since v 1.9.0.

Changeset: 78ad8e4891a612ed4060553274f1686b2a16dd5c

comment:11 Changed 7 years ago by Scott González

Milestone: 1.10.01.9.2

comment:12 in reply to:  10 ; Changed 5 years ago by vee

Replying to Scott González:

Dialog: Set top and left properties in the default styles to avoid a bug in core. Fixes #8741 - Dialog: dialog with position:fixed goes offscreen when opening after scrolling down since v 1.9.0.

Changeset: 78ad8e4891a612ed4060553274f1686b2a16dd5c

I'm using 1.10.4 and it still not fixed.
How do you set left and top? Set on where?
It can't fix with set left top because when i drag that dialog still go off screen.
Maybe i set it wrong place?

<div id="modal-select-image" class="modal modal-media" title="Select image"></div><!--.modal-->

<style>
.modal-media {
    left: 0;
    top: 0;
} /* << -- this does not fix anything. */
</style>

comment:13 in reply to:  12 Changed 5 years ago by Scott González

Replying to vee:

I'm using 1.10.4 and it still not fixed.
How do you set left and top? Set on where?
It can't fix with set left top because when i drag that dialog still go off screen.
Maybe i set it wrong place?

You shouldn't be setting the position anywhere. It's already set in the CSS. What you're describing is a different bug entirely (offscreen during drag, not offscreen on open). See #9315. In the future, please do not comment on tickets that have been closed for over a year; file a new ticket with a reduced test case.

Note: See TracTickets for help on using tickets.