-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Attach the gestures to the correct (container or platform) view #12108
Conversation
How do we even write tests for this... |
handler.SetVirtualView(element); | ||
element.Handler = handler; | ||
handler.SetVirtualView(element); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PureWeen I spotted this. In the real code, we set Handler
first. It appears that SetVirtualView
also sets things, but those need to run later? Not quite sure how this is as setting Handler calls SetVertualView, but SetVirtualView also sets the Handler.
Stepping through the code, I think Handler does all the work as SetVirtualView bails out right away as the first check is:
if (VirtualView == view)
return;
So not even sure SetVirtualView is needed...
Will this also help with #7121 ? |
Not sure, this PR just fixes iOS. But let me confirm. |
It does not, but I think I found the cause and added a comment. |
src/Controls/src/Core/Platform/GestureManager/GestureManager.iOS.cs
Outdated
Show resolved
Hide resolved
/backport to net7.0 |
Started backporting to net7.0: https://github.com/dotnet/maui/actions/runs/4016766108 |
Description of Change
In Xamarin.Forms, the gestures were attached to the renderer not the actual view. This fixes #8330 because the FrameRenderer code was designed to work with gestures on the render.
In this PR I do 2 things:
_platformView = _handler.ToPlatform();
instead of_platformView = _handler.PlatformView
to ensure that we use the container view / renderer._platformView
when doing checks because that is what the gesture is attached to.Issues Fixed
Fixes #8330
Notes
Fixing the gestures like this causes this: #12116
But this is already an issue on Android and Windows... This is a separate issue, but depending on what we decide there determines how we should fix this....