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

Label wordwrap does not honor container MaxWidth #15785

Closed
zwikk opened this issue Jun 22, 2023 · 3 comments · Fixed by #16215
Closed

Label wordwrap does not honor container MaxWidth #15785

zwikk opened this issue Jun 22, 2023 · 3 comments · Fixed by #16215
Assignees
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-7.0.96 Look for this fix in 7.0.96 SR8! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! layout-grid legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working

Comments

@zwikk
Copy link

zwikk commented Jun 22, 2023

Description

PR #15022 fixes MaxRequestWidth and MaxRequestHeight and works mostly great! However, it seems a Label with WordWrap inside a container such as a Grid with MaximumWidthRequest, does not play along.

Steps to Reproduce

Consider the following XAML:

<Grid BackgroundColor="LightBlue" MaximumWidthRequest="600" Padding="10">
  <Label FontSize="20" 
         Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales eros nec massa facilisis venenatis. Sed fermentum porta diam eu pulvinar. Cras ornare ligula id finibus tincidunt. Sed sagittis aliquam neque sit amet commodo. Sed eget velit tortor. Nam ac fringilla leo, sit amet egestas quam. Praesent finibus sem ac nisi elementum sollicitudin. "
         LineBreakMode="WordWrap" />
</Grid>

On iOS (and MacOS) in portrait this looks fine (enforced by device width):

Simulator Screenshot - iPhone 14 - 2023-06-21 at 15 26 30

In landscape things fall apart:

Simulator Screenshot - iPhone 14 - 2023-06-21 at 15 26 33

On Android the behavior is exactly the opposite. Portrait mode doesn't look great:

Screenshot_1687420702

Landscape mode is fine:

Screenshot_1687420709

Link to public reproduction project repository

https://github.com/zwikk/maui-playground/tree/main/Source/MauiNet8Test

Version with bug

8.0.0-preview.5.8529

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, macOS, I was not able test on other platforms

Affected platform versions

iOS 16, Android, MacOS

Did you find any workaround?

No response

Relevant log output

No response

@zwikk zwikk added the t/bug Something isn't working label Jun 22, 2023
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jun 22, 2023
@mattleibow mattleibow added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jun 22, 2023
@mattleibow
Copy link
Member

@hartez thoughts?

@mattleibow mattleibow added this to the Backlog milestone Jun 22, 2023
@ghost
Copy link

ghost commented Jun 22, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@jfversluis
Copy link
Member

Since @jknaudt21 did the PR that is referenced maybe?

@jknaudt21 jknaudt21 self-assigned this Jul 18, 2023
jknaudt21 added a commit that referenced this issue Jul 21, 2023
When calculating the dimension constraints for a view, we take into
account the MaxWidth and MaxHeight as long as they are smaller than the
already established constraints.

Issues Fixed
Fixes #15785
@samhouts samhouts modified the milestones: Backlog, .NET 8 Jul 25, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! label Aug 8, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 7, 2023
@samhouts samhouts added the fixed-in-7.0.96 Look for this fix in 7.0.96 SR8! label Oct 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter fixed-in-7.0.96 Look for this fix in 7.0.96 SR8! fixed-in-7.0.100 fixed-in-7.0.101 fixed-in-8.0.0-preview.7.8842 Look for this fix in 8.0.0-preview.7.8842! layout-grid legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants