vaadin / multiplatform-runtime

4 stars 1 forks source link

Two loading indicators are displayed at the same time #90

Closed mletenay closed 3 years ago

mletenay commented 3 years ago

Using Vaadin 20.0.6 + MPR 5.0.3, when longer operation (several seconds) is being executed both V20 and V8 loading indicators are displayed at the same time and "Couldn't find the Flow loading indicator. Using an empty one." warning is logged in browser console.

The problem is very likely caused by the code of com.vaadin.mpr.core.client.MprLoadingIndicator.

private final native Element findFlowLoadingIndicator()
/*-{
    var divs = $doc.querySelectorAll('body > div.v-loading-indicator');

As of Vaadin 20.0.6, the Flow's loading indicator is (no longer?) immediate child of <body>, but of <vaadin-connection-indicator>.

So the proper code should probably look like

private final native Element findFlowLoadingIndicator()
/*-{
    var divs = $doc.querySelectorAll('body > vaadin-connection-indicator > div.v-loading-indicator');
mshabarov commented 3 years ago

Hello @mletenay, thanks for catching and reporting this issue. Indeed, the loading indicator element has been changed in Flow 6.x, so the MprLoadingIndicator::findFlowLoadingIndicator got obsolete. I've made a corresponding PR.