Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 of 14 tasks
Mohsens22 opened this issue Feb 3, 2021 · 10 comments
Open
2 of 14 tasks
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Something isn't working triage/potentially-fixed Categorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified

Comments

@Mohsens22
Copy link

Mohsens22 commented Feb 3, 2021

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
@Mohsens22 Mohsens22 added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 3, 2021
@Mohsens22
Copy link
Author

uwp.mp4
wasm.mp4

@francoistanguay francoistanguay added this to the 3.5 milestone Feb 4, 2021
@francoistanguay
Copy link
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!

@carldebilly
Copy link
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.

@Mohsens22
Copy link
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.

@MartinZikmund
Copy link
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?

@jeromelaban
Copy link
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.

@MartinZikmund
Copy link
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

@Mohsens22
Copy link
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?

@Mohsens22
Copy link
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.

@Mohsens22
Copy link
Author

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

@MartinZikmund MartinZikmund reopened this Feb 4, 2021
@jeromelaban jeromelaban removed this from the 3.5 milestone Feb 4, 2021
@jeromelaban jeromelaban added the difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. label Feb 15, 2021
@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI triage/potentially-fixed Categorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified and removed difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. triage/untriaged Indicates an issue requires triaging or verification labels Jun 4, 2021
@MartinZikmund MartinZikmund added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Something isn't working triage/potentially-fixed Categorizes an issue as potentially fixed by some unlinked PR, fix needs to be verified
Projects
Status: No status
Development

No branches or pull requests

5 participants