user592704
user592704

Reputation: 3704

GWT - DialogBox glass and GoogleChrome - glass doesn't repaint

I have just installed the newest google chrome and just trying to test GWT 2.3 code with DialogBox; For some reason the option like setGlassEnabled(true); works in a strange way :(

If chrome's scroll pane (y position is 0) the glass is painted correct

but if chrome's scroll pane (y position is > 0) then the glass is keeping in 0 position so the chrome's rest bottom is not covered with glass :(

I am to show my constructor first glass options as

...
public MyDIalog() {

        this.setGlassEnabled(true);
        this.setAnimationEnabled(true);
        this.setModal(true);
        this.setPreviewingAllNativeEvents(true);
...

I am not pretty sure what makes the bug or something because the code works fine in IE and FF :S

So I guess in the chrome the glass position is always static or something and its location is always

x,y{0,0} w,h{firstInitedWidth,firstInitedHeight}

So my question is is there a walk around for chrome?

Thanks

Upvotes: 1

Views: 1383

Answers (3)

Kirk Backus
Kirk Backus

Reputation: 4866

As an alternative, without having to set the width and height, you can always set the CSS property to fixed (using the !important directive)

.gwt-PopupPanelGlass {
    position:fixed!important;
}

Upvotes: 0

qwertzguy
qwertzguy

Reputation: 17727

Solved:

Make your own class that extends PopupPanel and add this:

    @Override
    public void setGlassEnabled(boolean enabled) {
        super.setGlassEnabled(enabled);
        Element glass = getGlassElement();
        if (glass != null) {
            glass.getStyle().setPosition(Position.FIXED);
        }
    }

This simply sets the position of the glass panel to fixed instead of absolute. This makes the panel not move with the scroll.

Upvotes: 6

Ian Jacobs
Ian Jacobs

Reputation: 5501

Odd.... but I suppose worst case you can give the glass style some insane height/width in the css.

.gwt-PopupPanelGlass{
    height:15000 px;
    width:15000 px;
}

Upvotes: 0

Related Questions