microspaze / RGPopup.Maui

Popup controls for .NET MAUI migrated from Rg.Plugins.Popup for Xamarin with some fixes.
MIT License
42 stars 10 forks source link

TapGestureRecognizers not working? #4

Closed jameslavery closed 7 months ago

jameslavery commented 8 months ago

It seems that TapGestureRecognizers are not working on controls placed in an RGPopup.Maui page.

Adding a TapGestureRecognizer with either a Tapped event or a bound Command does not work - the associated Tapped event handler or Command are not invoked.

Pretty easy to reproduce - just add a TapGestureRecognizer to a control on an RGPopup page. I can provide a reproduction project if needed.

It's quite a problem for me, as I have a custom control with a TapGestureRecognizer which won't work if it's on an RGPopup.Maui page.

This occurs on both Windows (which is what I'm currently developing for) and Android.

microspaze commented 8 months ago

@jameslavery I have added two tag gesture demos in RGPopup.Samples project by commit https://github.com/microspaze/RGPopup.Maui/commit/2933eda8551212db948a9868ff99982c2b59c26d You can pull the code to verify by yourself. It works on both Windows and Android. If YOU CAN UPLOAD A REPRODUCE DEMO PROJECT, I will take a deeper look. Thanks.

jameslavery commented 7 months ago

That's interesting, thank you. I will check the samples and if I continue to have a problem, I'll upload a repro project.

jameslavery commented 7 months ago

This is odd - my code looks similar to the demo code you've added, but still doesn't work.

I've added a reproduction project to GitHub here - please take a look when you have a chance.

microspaze commented 7 months ago

Your demo prject works for me! Can you rebuild your whole project and try again?

https://github.com/microspaze/RGPopup.Maui/assets/17372096/f4ba8ec1-2830-45d2-af62-ff77c6f0e423

jameslavery commented 7 months ago

Gosh - that's really strange. I've rebuilt previously and it definitely doesn't work for me. I wonder if it's a MAUI version difference between our environments. What version of MAUI are you running?

dotnet workload list gives the following versions for me:

Installed Workload Id      Manifest Version       Installation Source
--------------------------------------------------------------------------------------
maui                       8.0.6/8.0.100          SDK 8.0.100
maui-windows               8.0.6/8.0.100          VS 17.7.34031.279, VS 17.8.34601.278
maui-maccatalyst           8.0.6/8.0.100          VS 17.7.34031.279
maccatalyst                17.2.8004/8.0.100      VS 17.7.34031.279, VS 17.8.34601.278
maui-ios                   8.0.6/8.0.100          VS 17.7.34031.279
ios                        17.2.8004/8.0.100      VS 17.7.34031.279, VS 17.8.34601.278
maui-android               8.0.6/8.0.100          VS 17.7.34031.279
android                    34.0.43/8.0.100        VS 17.7.34031.279, VS 17.8.34601.278
microspaze commented 7 months ago
Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------------------------
android                    34.0.85/8.0.100        VS 17.10.34707.107, VS 17.9.34622.214
maui-windows               8.0.7/8.0.100          VS 17.10.34707.107, VS 17.9.34622.214
maccatalyst                17.2.8043/8.0.100      VS 17.10.34707.107, VS 17.9.34622.214
ios                        17.2.8043/8.0.100      VS 17.10.34707.107, VS 17.9.34622.214

BTW, I'm using windows 11.

jameslavery commented 7 months ago

So I'm slightly behind on maui-windows. I'll try updating and let you know the results. May not be for a day or so though.

jameslavery commented 7 months ago

Actually updated my workloads just now (decided risk was low) - this fixed the problem!

So there must have been a change in 8.0.7 which fixed it.

Thank you for helping me find a solution!