dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.98k stars 1.71k forks source link

Frame not fitting to changing label #23790

Closed TheFrieber closed 1 month ago

TheFrieber commented 1 month ago

Description

TL:DR When creating a new line in a label that's inside a frame, it's outside of the frame. Need to rescale the window for it to update(I couldn't update it in anyway per code)

        <!-- Main Content -->
        <ContentView x:Name="ContentArea"
                     Grid.Row="1"
                     VerticalOptions="FillAndExpand"
                     HorizontalOptions="FillAndExpand">
            <CollectionView x:Name="MessagesCollectionView"
                            ItemsSource="{Binding Messages}">
                <CollectionView.ItemTemplate>
                    <DataTemplate>
                        <Frame Margin="10"
                               Padding="10"
                               HasShadow="False"
                               CornerRadius="15"
                               BackgroundColor="{Binding IsUser, Converter={StaticResource BoolToColorConverter}}">
                            <StackLayout Orientation="Vertical">
                                <Label Text="{Binding Text}"
                                   TextColor="Black"
                                   HorizontalOptions="FillAndExpand"
                                   VerticalOptions="FillAndExpand"
                                   LineBreakMode="WordWrap"
                                   HorizontalTextAlignment="Start"/>
                            </StackLayout>
                        </Frame>
                    </DataTemplate>
                </CollectionView.ItemTemplate>
            </CollectionView>
        </ContentView>

image image

Steps to Reproduce

  1. Add a CollectionView
  2. Beneath a Frame
  3. A Label
  4. Bind the label's text
  5. Bind the ItemSoruce
  6. Add item to collectionview
  7. Change it afterwards and add a new line

Link to public reproduction project repository

No response

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

Adding MinimumHeightRequest into the label, so the frame doesn't need to update (Not really a workaround.)

Relevant log output

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

TheFrieber commented 1 month ago

Updated to 8.0.70 seems to be fixed.