xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[Bug] Quick navigation in shell on iOS shows the latest page without controls #12226

Open ilnur-nazmutdinov-spark opened 4 years ago

ilnur-nazmutdinov-spark commented 4 years ago

Description

When the navigation in shell is performed quickly on iOS it doesn't show pages correctly. The latest shown page is rendered empty. Almost all controls are not visible.

In my project (but not in the attached example) it sometimes also throws this exception:

System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].get_CanBecomeFirstResponder () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementRenderer.cs:118 
  at Xamarin.Forms.Platform.iOS.PageRenderer.OnShouldReceiveTouch (UIKit.UIGestureRecognizer recognizer, UIKit.UITouch touch) [0x0001b] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:478 
  at UIKit.UIGestureRecognizer+_UIGestureRecognizerDelegate.ShouldReceiveTouch (UIKit.UIGestureRecognizer recognizer, UIKit.UITouch touch) [0x0000a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UIGestureRecognizer.g.cs:1002 

Steps to Reproduce

CanBecomeFirstResponderExample.zip

The example has 2 pages in shell: page 1 and page 2, each of them can be navigated to one another. Quickly press buttons "Page 1" and "Page 2".

Sometimes it can be reproduced after 2 navigations, which happened for one of our users. In our app the buttons are placed on the same places on all pages and the user just pressed 2 times on the same place and it happened.

Basic Information

Workaround

The NullReferenceException can be fixed with this: FixedPageRenderer.cs.zip. But when it happens the pages are still empty.

artem-metliakov commented 4 years ago

Hi there! What's the status of this bug? It affects our users so we need to know what the plan is?