Giter Club home page Giter Club logo

Comments (10)

MobileSam avatar MobileSam commented on July 17, 2024

The problem lies in PopupViewImpl doCenter() method.

private void doCenter() {
    boolean wasVisible = asPopupPanel().isShowing();
    asPopupPanel().center();
    if (!wasVisible) {
        asPopupPanel().hide();
    }
}

The method is using the GWT's PopupPanel center() method which state:
"Centers the popup in the browser window and shows it. If the popup was already showing, then the popup is centered."

http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/PopupPanel.html#center()

 
To resolve the issue, we would need to implement doCenter() without relying on PopupPanel

from gwtp.

branflake2267 avatar branflake2267 commented on July 17, 2024

Good catch.

I saw this too recently some else was having issues on centering.

from gwtp.

branflake2267 avatar branflake2267 commented on July 17, 2024

#13

from gwtp.

MobileSam avatar MobileSam commented on July 17, 2024

The fix I made does not fix the issue #13 as it seem to be more related to the CSS not being loaded when the getOffsetWidth() is called in doCenter().

from gwtp.

branflake2267 avatar branflake2267 commented on July 17, 2024

I think it solves one issue, shifting after its slightly rendered.

I noticed that it adds to the dom by root event, and then centers. But it would be nice to add more controls to that event process. It seems that the timing to attaching to the dom and center is fussy, in relation to the css, but I wanted to explore that more.

from gwtp.

branflake2267 avatar branflake2267 commented on July 17, 2024

One of my thoughts was instead of solving it, give control on when the centering occurs through the event, two step process, or see if I could wait for attaching event then center, but I wasn't sure that occurred before or after rendering of css.

from gwtp.

MobileSam avatar MobileSam commented on July 17, 2024

If the element is not attached when you try to center it, isn't that normal that the css is not taken into account for the calculs?

from gwtp.

branflake2267 avatar branflake2267 commented on July 17, 2024

Good point, it would have to be attached to get the width and height for calcs.

from gwtp.

branflake2267 avatar branflake2267 commented on July 17, 2024

Trying to find my source, but I was testing it out: http://gwtp-sandbox.appspot.com/

from gwtp.

branflake2267 avatar branflake2267 commented on July 17, 2024

I'm going to close this issue since fix was merged. I haven't heard anything on this for a while. I think we can iterate improvements as they come up.

This issue can be used to research the popup in closer detail in the future and help make improvements in the future.
#13

from gwtp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.