Project

General

Profile

Actions

Bug #13692

open

JS layout not being updated after animation in WStackedWidget

Added by Romain Mardulyn 11 days ago. Updated 7 days ago.

Status:
Review
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/07/2025
Due date:
% Done:

0%

Estimated time:

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.

Actions #2

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.

Actions #3

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.

Actions #4

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

Actions #5

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.

Actions #6

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
Actions #7

Updated by Romain Mardulyn 7 days ago

  • Assignee deleted (Romain Mardulyn)
Actions #8

Updated by Bruce Toll 7 days ago

The issue regarding animation in a WStackedWidget reminded me of #11345 and #7082, although I have no idea if they are actually related. I realize that there have been many improvements in Wt since those were filed.

Actions

Also available in: Atom PDF