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

[BUG] Buttons or any view not firing inside Layout that has a TouchBehavior #2429

Open
2 tasks done
arahmancsd opened this issue Jan 7, 2025 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working unverified

Comments

@arahmancsd
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

The touch behavior in the parent view overrides the event on the nested view.

<VerticalStackLayout
    Padding="30,0"
    Spacing="25">
    <VerticalStackLayout.Behaviors>
        <mct:TouchBehavior PressedOpacity="0.5"/>
    </VerticalStackLayout.Behaviors>
    <Image
        Source="dotnet_bot.png"
        HeightRequest="185"
        Aspect="AspectFit"
        SemanticProperties.Description="dot net bot in a hovercraft number nine" />

    <Label
        Text="Hello, World!"
        Style="{StaticResource Headline}"
        SemanticProperties.HeadingLevel="Level1" />

    <Label
        Text="Welcome to &#10;.NET Multi-platform App UI"
        Style="{StaticResource SubHeadline}"
        SemanticProperties.HeadingLevel="Level2"
        SemanticProperties.Description="Welcome to dot net Multi platform App U I" />

    <Button
        x:Name="CounterBtn"
        Text="Click me" 
        SemanticProperties.Hint="Counts the number of times you click"
        Clicked="OnCounterClicked"
        HorizontalOptions="Fill" />
</VerticalStackLayout>

Expected Behavior

Click on the button should work when a touch behavior is set on the parent view.

Steps To Reproduce

  1. Download the repo and run it.
  2. Click on the button doesn't work while it should work.

Link to public reproduction project repository

https://github.com/arahmancsd/MauiTouchBehavior.git

Environment

- .NET MAUI CommunityToolkit: 10.0.0
- OS: iOS, Android
- .NET MAUI: 9.0.21

Anything else?

A close issue #2385 shows it is resolved, but it isn't.

@arahmancsd arahmancsd added bug Something isn't working unverified labels Jan 7, 2025
@bricefriha
Copy link

bricefriha commented Jan 7, 2025

I reported the same issue (#2385), but it's meant to be fixed now after the .NET 9 support #2215.

Edit

I confirm the issue is still there on 10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unverified
Projects
None yet
Development

No branches or pull requests

2 participants