Skip to content

Commit 3d5def7

Browse files
committed
Fix missing iOS navigation events and removes duplicate page (dis)appearing events
1 parent e25f0f7 commit 3d5def7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Sentry.Maui/Internal/MauiEventsBinder.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,16 @@ public void HandleApplicationEvents(Application application, bool bind = true)
3434
{
3535
if (bind)
3636
{
37-
// Attach element events to all descendents as they are added to the application.
37+
// Attach element events to all existing descendants.
38+
foreach (var descendant in application.GetVisualTreeDescendants().Skip(1))
39+
{
40+
if (descendant is VisualElement element)
41+
{
42+
OnApplicationOnDescendantAdded(application, new ElementEventArgs(element));
43+
}
44+
}
45+
46+
// Attach element events to all descendants as they are added to the application.
3847
application.DescendantAdded += OnApplicationOnDescendantAdded;
3948
application.DescendantRemoved += OnApplicationOnDescendantRemoved;
4049

0 commit comments

Comments
 (0)