vaadin / multiplatform-runtime

4 stars 1 forks source link

Page loading hangs if legacy wrapper is hidden #91

Closed mshabarov closed 3 years ago

mshabarov commented 3 years ago

Description of the bug / feature

When the LegacyWrapper is being turned to hidden state (.setVisible(false)), or it is wrapped into a div which is hidden, then the initial page loading stucks with hanging and blinking loading indicator. The page content itself is rendered fine. As soon as the element is turned in visible state, the loading process completes fine.

Minimal reproducible example

This issue can be reproduced with InvisibleElementWithLegacyChildView test page. Here is repetition of the test page codes:

@Route("com.vaadin.test.InvisibleElementWithLegacyChildView")
public class InvisibleElementWithLegacyChildView extends Div
        implements HasLegacyComponents {

    public InvisibleElementWithLegacyChildView() {
        LegacyWrapper wrapper = new LegacyWrapper(
                new Label("A Legacy Element"));

        Div wrapperDiv = new Div();
        wrapperDiv.add(wrapper);
        wrapperDiv.setVisible(false);

        add(wrapperDiv);
    }
}

Run the jetty and open localhost:9998/com.vaadin.test.InvisibleElementWithLegacyChildView.

Expected behavior

Page is being loading fine.

Actual behavior

Loading indicator hangs and blinks.

Versions:

- Vaadin / Flow version: flow 7.0.7, 8.0.0.beta3, 9.0.0.alpha2, 2.6.7, 2.7.0.alpha2.
- MPR: 2.2.3
- Vaadin Framework 8.13.0
- Java version: 1.8
- OS version: MacOS
- Browser version (if applicable): Chrome 92
- Application Server (if applicable): Jetty
- IDE (if applicable): IDEA