Bug #13692
openJS layout not being updated after animation in WStackedWidget
0%
Description
JavaScript layout do sometimes not render correctly on chrome or chromium. The size of the items in the layout are too large or not large enough. This bug does go away when the window is resized and seems to fix itself when the debugger is activated. This seems to happen when the content is in the WStackedWidget
of a WMenu
and the content is showed after being selected (not if it is loaded from the start). The previous content of showed by the WStackedWidget
also seems to have an impact on how big the bug is.
Updated by Romain Mardulyn 9 days ago
The bug also happens when I use firefox at home. I am not sure what the difference is.
Updated by Romain Mardulyn 9 days ago
- Subject changed from JS layout missplaced horizontally when on Chrome and Chromium to JS layout missplaced due to race condition
- Status changed from New to InProgress
- Assignee changed from Matthias Van Ceulebroeck to Romain Mardulyn
I finally understood the issue. The problem was due to the fact that we used both flex layout and JS layout on the same page. What is happening is that the size of the flex layout was changing the width of their common container after the resizing of the JS layout. The debugger was solving the bug by letting the browser compute the size of the flex layout before resizing with the JS layout.
This means that 2 problems need to be solved:
The JS layout should wait for the page to be computed before resizing.
The JS and flex layout should end up with the same size.
Updated by Stefan Bn 7 days ago
I can also confirm this error in Wt 4.11.4 and I see it in Firefox (Win10/Win11).
I use WStackedWidget
with WMenu
. In my pages I often use WVBoxLayout
with streched items that no longer stretch when the page is loaded (and jump to correct size after the window is resized).
In other pages I use resizable layouts WBoxLayout::setResizable
, these seem to work fine.
Is there a temporary workaround for this, that does not involve manual resizing the window? :-)
Stefan
Updated by Romain Mardulyn 7 days ago
Hello Stefan,
In the end, I found out the problem was due to the JS layouts not being updated after the animation it was switch in with and is only the case when using a WStackedWidget.
I do not know of a simple workaround, but removing the animation should solve the issue.
Updated by Romain Mardulyn 7 days ago
- Subject changed from JS layout missplaced due to race condition to JS layout not being updated after animation in WStackedWidget
- Status changed from InProgress to Review