dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.24k stars 1.76k forks source link

Button/ImageButton Released event does not fire after multi-touch unless finger is on the button #12037

Open ArrowCase opened 1 year ago

ArrowCase commented 1 year ago

Description

This bug is a variation of the multi-touch bug reported in #12033, but it affects both the Button and ImageButton controls. In the former issue, the bugs only affected ImageButton, with Button behaving correctly.

After being touched, the button control should fire the Released event once it is no longer being touched down. However, after a multi-touch elsewhere on the page, the event only fires if the finger is over the button when the touch is released.

Steps to Reproduce

Create a MAUI project with a Button or ImageButton control with Pressed and Released events. In my repro project, the event handlers print "pressed" and "released" to the Debug window. The blue ImageButton and the green Button have the event handlers.

  1. Touch and hold the button.
  2. Touch elsewhere on the page with another finger (it doesn't matter if this touch is held down).
  3. Slide the first finger off the button.
  4. Release the first touch.

Steps 2 and 3 can be performed in either order.

Expected Output

pressed
released

Actual Output

pressed

Note that if you simply touch the button, slide your finger away from the button, and then release, you will get the expected output with the Button control (but not ImageButton; see #12033). So we can see that it should work, but the multi-touch is disrupting it.

Link to public reproduction project repository

https://github.com/ArrowCase/TestMauiButton

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.19041.0

Did you find any workaround?

None.

Relevant log output

No response

Depends on

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

ArrowCase commented 1 year ago

Possibly related: https://github.com/microsoft/microsoft-ui-xaml/issues/1959

Zhanglirong-Winnie commented 1 year ago

Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on android device platform with sample project. TestMauiButton-master.zip Screenshot 2023-07-10 165836

vovanb commented 4 months ago

do you have solution? Same issue with Android and MAUI 8