Skip to content

Commit

Permalink
Don't tie toolbar to backbutton on windows (#7932)
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen authored Jun 15, 2022
1 parent 8604b3c commit f8f23f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/Controls/src/Core/ShellToolbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ internal void ApplyChanges()
{
var flyoutBehavior = (_shell as IFlyoutView).FlyoutBehavior;
#if WINDOWS
IsVisible = (BackButtonVisible ||
!String.IsNullOrEmpty(Title) ||
IsVisible = (!String.IsNullOrEmpty(Title) ||
TitleView != null ||
_toolbarTracker.ToolbarItems.Count > 0 ||
_menuBarTracker.ToolbarItems.Count > 0 ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,5 +437,25 @@ await CreateHandlerAndAddToWindow<ShellHandler>(shell, (handler) =>
return Task.CompletedTask;
});
}


// this is only relevant on windows where the title/backbutton aren't in the same
// area
[Fact(DisplayName = "Shell Toolbar not visible when only back button is present")]
public async Task ShellToolbarNotVisibleWhenOnlyBackButtonIsPresent()
{
SetupBuilder();

var shell = await CreateShellAsync((shell) =>
{
shell.CurrentItem = new ContentPage();
});

await CreateHandlerAndAddToWindow<ShellHandler>(shell, async (handler) =>
{
await shell.Navigation.PushAsync(new ContentPage());
Assert.False(IsNavigationBarVisible(handler));
});
}
}
}

0 comments on commit f8f23f4

Please sign in to comment.