Xamarin.forms: [Bug] Shell.FlyoutBehavior="Disabled" not working android emulator

Created on 14 Oct 2019  路  8Comments  路  Source: xamarin/Xamarin.Forms

Description

Shell.FlyoutBehavior="Disabled" does not make the flyout not appear when the user swipes from left to right. I have encountered this in android emulator (Android 9.0) and on an android phone.

Steps to Reproduce

  1. In a xamarin.forms shell project, add flyout to AppShell.Xaml
  2. <FlyoutItem FlyoutDisplayOptions="AsMultipleItems"> <ShellContent Title="browse" ContentTemplate="{DataTemplate local:ItemsPage}" /> <ShellContent Title="about" ContentTemplate="{DataTemplate local:AboutPage}" /> </FlyoutItem>
  3. In one of the pages like say AboutPage add Shell.FlyoutBehavior="Disabled" in the ContentPage tag

Expected Behavior

Flyout should not appear when the user swipes from left to right

Actual Behavior

The flyout appears.

  • Version with issue: 4.2.0.848062
  • Last known good version:
  • IDE: Visual Studio
  • Platform Target Frameworks:

    • iOS:

    • Android: 9.0 - API 28

    • UWP:

  • Android Support Library Version: 28.0.0.3
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

shell in-progress Android bug

All 8 comments

Hi @jsuarezruiz / @PureWeen ,

I tried to reproduce this issue with official Shell Sample 'Xaminals' initially with version v.4.2.0.709249 (purposely as I know that it has broken FlyoutBehavior as per https://github.com/xamarin/Xamarin.Forms/issues/7656#issuecomment-537648518) and as expected, it didn't work.

I then upgraded 'Xaminals' to latest stable version v.4.2.0.848062 (considering your PR#7254 was merged to vCurrent (4.2.0)) but again it didn't work.

In order to fix this issue, I then tried to reproduce this in Xamarin.Forms solution (master branch), but unable to reproduce the mentioned issue as it is working fine (tried replicating using existing ShellFlyoutBehavior.cs 'Disable Flyout Behavior' button and also created a new Issue7985.xaml page with Shell as a base class).

Does 'master' branch of Xamarin.Forms is not pointing to latest stable: v.4.2.0.848062 ? Or Is this issue fixed with any pre-release of v.4.3 (though unable to see any associated PR)?

Another thing as a side note I noticed that FlyoutBehavior can no longer be set to FlyoutItem, ShellContent, and page objects, to override the default flyout behavior. It is only available to set on Shell object. If this is correct, we should probably update the Xamarin doc. to avoid issues (refer 'Steps to Reproduce' section of this ticket).

Thanks!

This is with Xamarin.Forms (master) branch (where Flyout Behavior is working as expected):

image

This is with Xaminals (v.4.2.0.848062) (where Flyout Behavior is not working as expected):

image

Reg. this question -

Does 'master' branch of Xamarin.Forms is not pointing to latest stable: v.4.2.0.848062 ? Or Is this issue fixed with any pre-release of v.4.3 (though unable to see any associated PR)?

Just watched @jfversluis yesterday's stream recording and now it's clear. So 'master' branch contains future release changes (probably v.4.4) and may be that's the reason I'm not able to reproduce this bug with master branch. So, Does it mean this issue fix will be available with future versions? (I think it might be blocker for the people using the latest stable version v.4.2.0.848062).
Thanks!

@techduggu Thank you for looking into this one!!!

I'm not able to reproduce this bug with master branch

Same... Which I'm currently confused about :-/
I tested against the latest nightly and it's broken there so I'm thinking it's some ordering of initialization that's causing this but not sure yet.

Alright it looks like when you use ContentTemplate the flyout is calculated too early before the content page is renderered so it fails to walk up the tree and find the effective value :-/

If you define the default page inside the ShellContent opposed to in the ContentTemplate that should let you work around it for now

Cool. Good to know that it is reproducible in latest nightly build (which makes it a valid bug). I will try the above workaround as well and see if it works for me.

Considering you already know where it breaks, Will you be taking care of this bug or Is there something I can be of any help (as I'm anyways looking at the 'up-for-grabs' list :) )?

@techduggu I'll get it

I should have a PR today or tomorrow. Thanks again for all the exploration

Was this page helpful?
0 / 5 - 0 ratings