Xamarin.Forms icon indicating copy to clipboard operation
Xamarin.Forms copied to clipboard

[Bug] When a Shell Flyout item's "IsVisible" Property is changed at runtime on iOS only, we can not more do modal navigation

Open DamienDoumer opened this issue 3 years ago • 4 comments

Description

If you bind a Xamarin Shell Flyout Item's "IsVisible" property to a property in a ViewModel, then change the property's value from true to false at runtime, then try to navigate to a shell page with modal animation, the page never appears, though its life cycle events are called.

Steps to Reproduce

  1. bind the isvisible property of the shell's flyout item `

         <FlyoutItem Title="Browse" Icon="icon_feed.png"
             IsVisible="{Binding ShouldDisplayFlyoutItem}">
    
               <ShellContent Route="ItemsPage" ContentTemplate="{DataTemplate local:ItemsPage}"/>
    
        </FlyoutItem>
    

` 2. Change the value of this property from true to false a few seconds after app starts

`

    public void ChangeDisplayOption()
    {
        //Note: changing this value to false hides the "Browse" shell item. Thus caussing modal navigations to fail after this.
        //Note: if you comment this line, the bug disappears
        ShouldDisplayFlyoutItem = false;
    }

` 3. Trigger navigation to a shell page with modal navigation

`

        OpenWebCommand = new Command(async () =>
        {
            //await Browser.OpenAsync("https://aka.ms/xamarin-quickstart");

            //Navigate to modal to reproduce the bug.
            await Shell.Current.GoToAsync(nameof(NewItemPage));
        });

`

  1. The page never appears

Here is the source code to reproduce this issue. ShellbugReproduction.zip

Expected Behavior

No matter what value the IsVisible Property of the flyout is bound to, we must be able to perform modal navigation anywhere in the app.

Actual Behavior

Modal navigation doesn't show up though life cycle events are called

Basic Information

  • Version with issue: 5.0.0.7946
  • Last known good version:
  • Platform Target Frameworks:
    • iOS: 15.2
  • NuGet Packages: Xamarin.Forms
  • Affected Devices: iPhones

Environment

Any VS2019 version

Reproduction Link

ShellbugReproduction.zip

Workaround

NONE

DamienDoumer avatar Dec 29 '21 17:12 DamienDoumer

I have the same issue in one of our apps. Were you able to find a workaround @DamienDoumer?

AndreKraemer avatar Jan 31 '22 22:01 AndreKraemer

Nope, what I did was just to change my approach. I moved the page that needed a specific condition to be displayed away frrom the flyout menu. I was stuck, and didn't have enough time to experiment

DamienDoumer avatar Feb 04 '22 08:02 DamienDoumer

I can confirm I have the same exact issue only on iOS, at runtime if you change "IsVisible" or "FlyoutItemIsVisible" it won't allow to open pages after that (I tried update with binding and code behind - same result)

mmilkovski avatar Feb 16 '22 09:02 mmilkovski

Same issue for me. Any plan to fix it in a soon release?

abosquet avatar Sep 07 '22 14:09 abosquet

Same case here. Seems no progress on this issue, while the feature is crutial for a good app.

hugebug4ever avatar Dec 08 '22 16:12 hugebug4ever

This issue still presist aswell under Android!

SliemBeji-FBC avatar Sep 14 '23 09:09 SliemBeji-FBC