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

8.0.21 update breaks android label wrap feature which causes other controls exceeding layout borders #22083

Closed
sencagri opened this issue Apr 26, 2024 · 6 comments
Assignees
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Milestone

Comments

@sencagri
Copy link

Description

After updating to 8.0.21 label word wrap no more working. iOS is working fine.

Before (8.0.14) After (8.0.21)
image image

Code of DataTemplate below. The label control is quoted with double star(for reviewing purposes) in the code.

<DataTemplate x:Key="STOK" x:DataType="ekran:StokListeSatır">
    <c:GridSelected Padding="5,5,5,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="20" />
            <RowDefinition Height="5" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="{OnIdiom Default={StaticResource darSütunGenişlik}, Tablet={StaticResource darSütunGenişlikTablet}}" />
            <ColumnDefinition Width="{OnIdiom Default={StaticResource darSütunGenişlik}, Tablet={StaticResource darSütunGenişlikTablet}}" />
            <ColumnDefinition Width="{OnIdiom Default={StaticResource sütunGenişlik}, Tablet={StaticResource sütunGenişlikTablet}}" />
        </Grid.ColumnDefinitions>

        <Grid.GestureRecognizers>
            <TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=SeçCommand}" CommandParameter="{Binding K}"></TapGestureRecognizer>
            <SwipeGestureRecognizer Direction="Right" Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=DeğiştirCommand}"></SwipeGestureRecognizer>
            <SwipeGestureRecognizer Direction="Left" Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=MenüCommand}"></SwipeGestureRecognizer>
        </Grid.GestureRecognizers>

        <Border Grid.Row="0" Grid.Column="0" Grid.RowSpan="4" BackgroundColor="Transparent" Padding="3">
            <Border.StrokeShape>
                <RoundRectangle CornerRadius="0,10,0,0" />
            </Border.StrokeShape>
            <Grid RowDefinitions="*,20" BackgroundColor="Transparent">
                **<Label Grid.Row="0" VerticalTextAlignment="Start" BackgroundColor="Transparent" LineBreakMode="WordWrap"
                    Text="{Binding Ad}" FontAttributes="Bold"
                    TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" />**
                <Label Grid.Row="1"
                    Text="{Binding Barkod}"
                    FontSize="{StaticResource fontSizeSmall}" MaxLines="1"
                    TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" />
            </Grid>
        </Border>

        <Label Grid.Row="0" Grid.Column="1"
            Text="{Binding SatışFiyat, StringFormat='{0:n2}'}"
            FontAttributes="Bold" HorizontalTextAlignment="End"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" >
            <Label.GestureRecognizers>
                <TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=SatışFiyatDeğiştirCommand}" CommandParameter="{Binding K}"></TapGestureRecognizer>
            </Label.GestureRecognizers>
        </Label>

        <Label Grid.Row="1" Grid.Column="1"
            Text="{Binding SatışFiyatPBKod}" 
            FontSize="{StaticResource fontSizeSmall}" HorizontalTextAlignment="End"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}">
            <Label.GestureRecognizers>
                <TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=SatışFiyatDeğiştirCommand}" CommandParameter="{Binding K}"></TapGestureRecognizer>
            </Label.GestureRecognizers>
        </Label>

        <Label Grid.Row="2" Grid.Column="1"
            Text="{Binding PKDV, StringFormat='% {0:#,0.##}'}"
            FontSize="{StaticResource fontSizeSmall}" HorizontalTextAlignment="End"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" />

        <Label Grid.Row="3" Grid.Column="1" IsVisible="{Binding EtiketBas}"
            Text="{x:Static prop:Resources.Etiket_Bas}" HorizontalTextAlignment="End"
            FontSize="{StaticResource fontSizeSmall}"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" />

        <Label Grid.Row="0" Grid.Column="2"
            Text="{Binding AlışFiyat, StringFormat='{0:n2}'}" 
            FontAttributes="Bold" HorizontalTextAlignment="End"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}">
            <Label.GestureRecognizers>
                <TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=AlışFiyatDeğiştirCommand}" CommandParameter="{Binding K}"></TapGestureRecognizer>
            </Label.GestureRecognizers>
        </Label>

        <Label Grid.Row="1" Grid.Column="2"
            Text="{Binding AlışFiyatPBKod}"
            FontSize="{StaticResource fontSizeSmall}" HorizontalTextAlignment="End"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}">
            <Label.GestureRecognizers>
                <TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=AlışFiyatDeğiştirCommand}" CommandParameter="{Binding K}"></TapGestureRecognizer>
            </Label.GestureRecognizers>
        </Label>

        <Label Grid.Row="2" Grid.Column="2"
            Text="{Binding TKDV, StringFormat='% {0:#,0.##}'}"
            FontSize="{StaticResource fontSizeSmall}" HorizontalTextAlignment="End"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" />

        <Label Grid.Row="3" Grid.Column="2"
            Text="{Binding HKar, StringFormat='% {0:#,0.##}'}"
            FontSize="{StaticResource fontSizeSmall}" HorizontalTextAlignment="End"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" />

        <Label Grid.Row="0" Grid.Column="3"
            Text="{Binding İMiktar, StringFormat='{0:#,0.###}'}"
            FontAttributes="Bold" FontSize="{StaticResource fontSizeSmall}" HorizontalTextAlignment="End"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" />

        <Label Grid.Row="1" Grid.Column="3"
            Text="{Binding Birim}"
            FontSize="{StaticResource fontSizeSmall}" HorizontalTextAlignment="End" MaxLines="1"
            TextDecorations="{Binding Aktif, Converter={StaticResource aktifToTextDecorationConverter}}" />

        <Border Grid.Row="2" Grid.Column="3" Grid.RowSpan="2" BackgroundColor="{AppThemeBinding Light={StaticResource ButtonBackgroundLight}, Dark={StaticResource ButtonBackgroundDark}}" Padding="3" Margin="2">
            <Border.StrokeShape>
                <RoundRectangle CornerRadius="10,0,0,0" />
            </Border.StrokeShape>
            <Grid RowDefinitions="*" ColumnDefinitions="*,*,*">
                <ImageButton Grid.Column="0"
                    Source="{AppThemeBinding Light=b_edit, Dark=w_edit}" 
                    Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=DeğiştirCommand}" CommandParameter="{Binding K}"  
                    HorizontalOptions="Center" VerticalOptions="Center" />
                <ImageButton Grid.Column="1"
                    Source="{AppThemeBinding Light=b_info, Dark=w_info}" 
                    Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=TümSütunlarCommand}" CommandParameter="{Binding K}"  
                    HorizontalOptions="Center" VerticalOptions="Center" />
                <ImageButton Grid.Column="2"
                    Source="{AppThemeBinding Light=b_menu, Dark=w_menu}" 
                    Command="{Binding Source={RelativeSource AncestorType={x:Type liste:ListeController}}, Path=MenüCommand}" CommandParameter="{Binding K}"  
                    HorizontalOptions="Center" VerticalOptions="Center" />
            </Grid>
        </Border>
        <BoxView Grid.Row="4" Grid.ColumnSpan="4" HeightRequest="1" Color="{AppThemeBinding Light={StaticResource SeperatorLight}, Dark={StaticResource SeperatorDark}}" VerticalOptions="End"></BoxView>
    </c:GridSelected>
</DataTemplate>

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.21 SR4.1

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.14 SR3.1

Affected platforms

Android

Affected platform versions

All android versions

Did you find any workaround?

Nope

Relevant log output

No response

@sencagri sencagri added the t/bug Something isn't working label Apr 26, 2024
@PureWeen PureWeen added platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending labels Apr 26, 2024
@PureWeen PureWeen added this to the .NET 8 SR5 milestone Apr 26, 2024
@PureWeen PureWeen added the s/needs-repro Attach a solution or code which reproduces the issue label Apr 26, 2024
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Apr 30, 2024
@jkommeren
Copy link

jkommeren commented May 3, 2024

Does it still need a repro? There is code supplied right?

Im having the same issue. Its not very complex to reproduce. I could host the code on GitHub if desired

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels May 3, 2024
@PureWeen
Copy link
Member

PureWeen commented May 6, 2024

@jkommeren If you could that'd be very helpful!

@PureWeen PureWeen added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels May 6, 2024
@sencagri
Copy link
Author

sencagri commented May 6, 2024

I will create a repo for it.

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels May 6, 2024
@jkommeren
Copy link

jkommeren commented May 7, 2024

Does it still need a repro? There is code supplied right?

Im having the same issue. Its not very complex to reproduce. I could host the code on GitHub if desired

Well I spoke to soon. Not so sure the underlying cause is the same in my own case. I'll create a separate ticket for it once I've narrowed it down.

(This bug might still be valid though)

@sencagri good luck!

@PureWeen PureWeen added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels May 7, 2024
@sencagri
Copy link
Author

sencagri commented May 7, 2024

Hello again,

I have identified the bug and its cause. The issue in Android systems is caused by the ItemSizingStrategy property when it is set to "MeasureFirstItem."

Below is the repro link:
https://github.com/sencagri/layout_exceed_bug/

Thank you.

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels May 7, 2024
@PureWeen
Copy link
Member

PureWeen commented May 8, 2024

Duplicate of #21967

@PureWeen PureWeen marked this as a duplicate of #21967 May 8, 2024
@PureWeen PureWeen closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/android 🤖 potential-regression This issue described a possible regression on a currently supported version., verification pending s/needs-attention Issue has more information and needs another look t/bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

4 participants