-
Notifications
You must be signed in to change notification settings - Fork 49
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
Closing popup causes crash in IOS #25
Comments
@LuckyDucko tagging you here as I don't think I can assign you. |
@Mous625 all good, ill sort this one out asap, downgrading makes it work? |
@LuckyDucko Thank you for your prompt reply. Just checked, and downgrading to 1.0.1 makes it work if closing the popup using MopupService manually. However, the error does occur if the user attempts to close the popup by swiping down on it. P.S when I say manually I mean using the |
That makes sense, as its an issue with the HitTest function, ill let you know when its sorted 👍 |
So curiosity got the better of me and I decided to have a look and added the Mopups project to my own. The error was happening when trying to cast a ViewCell to a VisualElement. I'm not an expert by any means, so I just added a try-catch to that section to ignore cast exceptions and it worked without issues. Please note I have no idea whether simply ignoring the ViewCell is the right approach but this may help speed up the process for you. Here is the code: private static void DisposeModelAndChildrenHandlers(VisualElement view)
{
foreach (VisualElement child in view.GetVisualTreeDescendants())
{
try //<-------- added by me
{
IViewHandler handler = child.Handler;
child?.Handler?.DisconnectHandler();
(handler?.PlatformView as UIView)?.RemoveFromSuperview();
(handler?.PlatformView as UIView)?.Dispose();
}
catch(Exception){} //<-------- added by me
}
view?.Handler?.DisconnectHandler();
(view?.Handler?.PlatformView as UIView)?.RemoveFromSuperview();
(view?.Handler?.PlatformView as UIView)?.Dispose();
} |
Still getting round to this, just been having issues with my Macbook, so i can't poke where the issues may be, sorry for the delay! |
@Mous625 could you provide a sample project for me to work off? I just tested it then, and it seems to work quite fine on the default project. Perhaps its because you use shell? Either way, I have a fix in mind, just wanting to get a test case running so I know ---EDIT---- Scratch that, I can probably just add any version of the "Cell" class in for testing |
@Mous625 Does the following change fix the issue?
I dont understand why I settled on VisualElement, as this is much more robust if it works |
This should be addressed by v 1.0.3 |
My apologies I forgot to respond as I got bogged down by a new project. This fixes the issue. Thanks. |
Hello, |
Using the
await MopupService.Instance.PopAsync()
causes the app to crash specifically on IOS. On Android, all works well. You can see the error message and stack trace in the image attached.If I wrap the
await MopupService.Instance.PopAsync()
in a try catch, the exception is swallowed however the app still crashes once the screen is touched. Error message and stack trace attached below:Things to note:
The
ConfigureMopups()
line is added in MauiProgram.cs.For navigation, I am using Shell.
Steps to reproduce (Screenshot 1):
await MopupService.Instance.PushAsync(<Popup>)
await MopupService.Instance.PopAsync()
Steps to reproduce with try-catch (screenshot 2):
await MopupService.Instance.PushAsync(<Popup>)
await MopupService.Instance.PopAsync()
(exception doesn't cause crash)The text was updated successfully, but these errors were encountered: