-
Notifications
You must be signed in to change notification settings - Fork 464
Closed
Labels
area/behaviorsIssue/Discussion/PR that has to do with BehaviorsIssue/Discussion/PR that has to do with BehaviorsbugSomething isn't workingSomething isn't workingunverified
Description
Is there an existing issue for this?
- I have searched the existing issues
Did you read the "Reporting a bug" section on Contributing file?
- I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
Current Behavior
When adding a TouchBehavior to a simple Grid layout, a Label inside the Grid is sometimes not displayed properly.
See screenshots, with or without TouchBehavior.
Here is the xaml code for the ItemView:
<ContentView
x:Class="MauiAppMctTouchBehaviorLabelTruncation.ItemView"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mauiAppMctTouchBehaviorLabelTruncation="clr-namespace:MauiAppMctTouchBehaviorLabelTruncation"
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Name="ItemViewRef"
x:DataType="mauiAppMctTouchBehaviorLabelTruncation:ItemViewModel">
<Border
Margin="10"
Padding="10"
BackgroundColor="LightCyan"
Stroke="Black">
<Border.Behaviors>
<mct:TouchBehavior BindingContext="{Binding BindingContext, Source={x:Reference ItemViewRef}}" Command="{Binding TapCommand}" />
</Border.Behaviors>
<Grid ColumnDefinitions="*,Auto">
<ContentView Grid.Column="2">
<Label
BackgroundColor="LightGoldenrodYellow"
Text="{Binding Title}"
TextColor="Black" />
</ContentView>
</Grid>
</Border>
</ContentView>Expected Behavior
The Label should be displayed the same, with or without the TouchBehavior.
Steps To Reproduce
- Open the repro.
- When there is a TouchBehavior, some Items are not displayed properly.
- Remove the TouchBehavior, everything is back to normal.
Link to public reproduction project repository
https://github.com/tranb3r/Issues/tree/main/MauiAppMctTouchBehaviorLabelTruncation
Environment
- .NET MAUI CommunityToolkit:8.0.x
- OS:Android
- .NET MAUI:8.0.14Metadata
Metadata
Assignees
Labels
area/behaviorsIssue/Discussion/PR that has to do with BehaviorsIssue/Discussion/PR that has to do with BehaviorsbugSomething isn't workingSomething isn't workingunverified
