Xamarin.Forms
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
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
-
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));
});
`
- 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
Workaround
NONE
I have the same issue in one of our apps. Were you able to find a workaround @DamienDoumer?
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
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)
Same issue for me. Any plan to fix it in a soon release?
Same case here. Seems no progress on this issue, while the feature is crutial for a good app.
This issue still presist aswell under Android!