Skip to content

A page is consuming more width than what the parent window gives the space. #5125

Closed

Description

@ryan-seifi

Current behavior

I have a page in my uno project. In UWP everything is just fine and every page is working as expected. But in one of my pages where I show some information to the user, the page gets an extremely high width (tested in WASM) and it gets out of the window border. In order to see the page fully, I need to zoom out via the browser's zooming tool.

However there is a fun fact here:
I used a visual state manager. This visual state manager acts just fine and responds to window size changes and applies what should be applied, however, the the page still uses more width,

Expected behavior

I expect the page to be stretched to the parent frame and window as it's happening in UWP.

How to reproduce it (as minimally and precisely as possible)

Here is a link to my repo

Firstly run the UWP application in DEBUG mode and from the start page hit the "LoadTestAnswer" button. this button will load some dummy data:
image
image
image

As you can see, the UI is pretty responsive and neat.
However if you do the same to the WASM project you'll notice that something is wrong:

image
image
image

As you can see, although the page reacts to the implemented Visual State Manager, the actual page does not fit itself to the frame which is kinda odd.

Environment

  • [x ] Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows

I have not tested this on other platforms, I can not tell if this issue exists on other platforms or not.
IDE:

  • [x ] Visual Studio 2019 (version: latest)

Anything else we need to know?

  • I wasn't able to do any AOT compilation

Activity

  1. added
    kind/bug
    triage/untriaged
    on Feb 3, 2021
  2. ryan-seifi commented on Feb 3, 2021

    @ryan-seifi
    Author
    uwp.mp4
    wasm.mp4
  3. added this to the 3.5 milestone on Feb 4, 2021
  4. francoistanguay commented on Feb 4, 2021

    @francoistanguay
    Contributor

    Special mention and kudos for the IMPRESSIVE quality of your bug report. We'll have the team look at it asap and keep you posted.

    Thank you for taking the time to properly file this, it's beyond appreciated.

    12/10!

  5. carldebilly commented on Feb 4, 2021

    @carldebilly
    Member

    This looks like the result of an exception during the layouting. On wasm, a lot of exceptions are not catched because of a performance issue.

    Please press F12 and check the console for error messages.

  6. ryan-seifi commented on Feb 4, 2021

    @ryan-seifi
    Author

    @carldebilly
    localhost-1612320307231.log

    Here is a dump from my console while running in Debug and navigating through pages. I took a look at it and honestly I didn't see anything problematic.

  7. MartinZikmund commented on Feb 4, 2021

    @MartinZikmund
    Member

    @mohsens22 I noticed the results page is wrapped in a ScrollViewer, it seems adding HorizontalScrollMode="Disabled" to it fixes the problem. Can you test on your side please, as a workaround?

  8. jeromelaban commented on Feb 4, 2021

    @jeromelaban
    Member

    Also note that Pivot may show a ScrollViewer issue (there's one in the template). You can try overriding the Pivot control template and see if removing the ScrollViewer in the template helps.

  9. MartinZikmund commented on Feb 4, 2021

    @MartinZikmund
    Member

    From my debugging, it seems that SfChart gets Infinite available width in MeasureOverride, whereas on UWP it always gets only the width equal to the window size

  10. ryan-seifi commented on Feb 4, 2021

    @ryan-seifi
    Author

    From my debugging, it seems that SfChart gets Infinite available width in MeasureOverride, whereas on UWP it always gets only the width equal to the window size

    @MartinZikmund How can we fix it?

  11. ryan-seifi commented on Feb 4, 2021

    @ryan-seifi
    Author

    Also note that Pivot may show a ScrollViewer issue (there's one in the template). You can try overriding the Pivot control template and see if removing the ScrollViewer in the template helps.

    @jeromelaban I am not using any Pivot, I use a tab view from the Community Toolkit.

  12. ryan-seifi commented on Feb 4, 2021

    @ryan-seifi
    Author

    I fixed the issue by setting HorizontalAlignment="Stretch" and disabling the horizontal scroll viewer in the grid.

  13. 2 remaining items

  14. added
    difficulty/medium 🤔
    triage/potentially-fixed
    and removed
    difficulty/tbd
    triage/untriaged
    on Jun 4, 2021
  15. added
    good first issue
    on Jul 10, 2023
  16. github-actions commented on Jul 29, 2025

    @github-actions
    Contributor

    Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.

  17. added
    stale
    on Jul 29, 2025
  18. MartinZikmund commented on Jul 29, 2025

    @MartinZikmund
    Member

    This works correctly in Skia Renderer targets

  19. github-actions commented on May 3, 2026

    @github-actions
    Contributor

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests.

  20. locked as resolved and limited conversation to collaborators on May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/medium 🤔good first issuekind/bugstaletriage/potentially-fixed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions