-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Tap Events Incorrectly passed Through Button #26640
Comments
In PR #25311 ,MAUI has recently implemented a fix to trigger the tap event for controls using a gesture recognizer. Based on this implementation, the reported issue appears to be a behavior originating from the native side. I have shared a video and code snippet for reference. <StackPanel IsTapEnabled="True" Tapped="StackPanel_Tapped" Orientation="Horizontal" HorizontalAlignment="Center" Background="red" Height="500" Width="500" VerticalAlignment="Center">
<Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
</StackPanel> WInui.mp4 |
This also affects our application. If this is intentional behavior, is there a way to selectively disable this behavior? Imagine you have some view that looks like the following. You want tapping on this view to navigate to a device, but you want tapping on the checkbox to not navigate, but select the checkbox. You may ask, why don't you make the bottom region a clickable zone. From a user's perspective (and a mobile perspective), they would expect all text, images, etc to allow navigation, but the checkbox to not navigate. |
This issue affects our app as well. @NirmalKumarYuvaraj Not really an expert but this line maui/src/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.Windows.cs Line 787 in 76e5cd0
seems suspicious to me. Is the edit: I tested changing -_container.AddHandler(FrameworkElement.TappedEvent, _tappedEventHandler, true);
+_container.AddHandler(FrameworkElement.TappedEvent, _tappedEventHandler, false); and it does not work. So no, that's not the way. |
This has a known problem on Windows, see: dotnet/maui#26640.
Maui controls 9.0.21 (SR2) makes nested tap detection unusable on Windows, see dotnet/maui#26640. This change disables it on Windows until it can be fixed (in SR3 allegedly).
Description
Clicks are passed through a button to the underlying control, for example using this XAML:
Tapping anywhere on the page will log an event on the page, tapping the button, or the ToolBar item, should clear the log page but tapping the button ALSO registers a tap on the page.
It works correctly on Android or using Microsoft.Maui.Controls Version 9.0.14, it just fails on 9.0.21.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/david-maw/SimpleCollectionView-Propagation.git
Version with bug
9.0.21 SR2.1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
9.0.14 SR1.4
Affected platforms
Windows, I was not able test on other platforms
Affected platform versions
Windows 11
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: