Bug 28762 - MasterDetailPage clears its own IsPresented when you move the phone around
Summary: MasterDetailPage clears its own IsPresented when you move the phone around
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 1.3.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-04-03 23:54 UTC by andrew
Modified: 2015-05-27 08:10 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description andrew 2015-04-03 23:54:04 UTC
See also this forum thread: https://forums.xamarin.com/discussion/37322/why-does-ios-masterdetailpage-jump-from-the-master-view-to-the-detail-view-when-i-move-the-phone#latest

Seeing a weird issue on two different iPhones running iOS 7.1 and 8.2. When I am viewing the master page with my menu, as long as I hold the phone very still, it will remain in that state. If I move the phone, it will jump to the detail page.

Repro detail: I can consistently make this happen in a portrait-only iPhone app by starting with the master menu displayed (content slid right mostly off screen), and the phone oriented vertically. Then I change the angle of the phone between reclining way back (like lying on the desk) versus standing up straight. This makes it happen every time for me.

It also happens frequently with subtler movement along the same axis, which makes the app really awkward to use because it keeps jumping away from the menu.

I found the following in the reflected MasterDetailPage.cs, which looks kind of suspicious:

private void HandlePropertyChanged(object sender, PropertyChangedEventArgs e)
  if (!(e.PropertyName == DeviceInfo.CurrentOrientationProperty.PropertyName))
  this.CanChangeIsPresented = true;
  if (!this.ShouldShowSplitMode)
    this.SetValueCore(MasterDetailPage.IsPresentedProperty, (object) false, BindableObject.SetValueFlags.None);

Apparently if the current orientation says it's changed, then it will force the master page "IsPresented" to false. I wonder if there's any way for that to be triggered when the orientation hasn't really changed, with just a little bit of phone accelerometer activity. If so, that would explain the bug I'm seeing.
Comment 1 Rui Marinho 2015-05-27 08:10:21 UTC
This was fixed in 1.4.2