-
Notifications
You must be signed in to change notification settings - Fork 417
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
Comments
I am facing this exact same issue. As of today's date, I have the latest communitytoolkit.Maui nuget package. Below is my xaml in case it helps paint the picture
|
I encountered a similar situation where I needed to manage nested touch behaviors. For example: In my case, I wanted to tap on the box to focus it while still allowing the dropdown to be used for selecting options. Initially, I applied touch behaviors to both the parent and child elements, as you might expect. However, I found that the parent’s touch behavior interfered with the child’s. To resolve this, I implemented a workaround where the parent’s touch behavior is temporarily disabled whenever the child’s touch behavior is triggered: private void PickerTouchBehavior_CurrentTouchStatusChanged( object sender, CommunityToolkit.Maui.Core.TouchStatusChangedEventArgs e )
{
if ( e.Status == CommunityToolkit.Maui.Core.TouchStatus.Started )
{
_primaryTouchBehavior.IsEnabled = false;
}
else
{
_primaryTouchBehavior.IsEnabled = true;
}
} While your setup might differ, this approach could still be applicable and help ensure smooth interactions in nested touch scenarios. |
Is there an existing issue for this?
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.
Expected Behavior
Click on the button should work when a touch behavior is set on the parent view.
Steps To Reproduce
Link to public reproduction project repository
https://github.com/arahmancsd/MauiTouchBehavior.git
Environment
Anything else?
A close issue #2385 shows it is resolved, but it isn't.
The text was updated successfully, but these errors were encountered: