Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabbedPage: WinUI: Back-button persists when swapping to a Tab that does not have a NavigationPage. #14689

Open
Keflon opened this issue Apr 20, 2023 · 1 comment
Labels
area-controls-tabbedpage TabbedPage platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@Keflon
Copy link

Keflon commented Apr 20, 2023

Description

Given a TabbedPage with Children, where

  • at least one Tab does not have a NavigationPage
  • at least one Tab does have a NavigationPage

If a back button is shown for the CurrentPage, then swapping to a Tab that does not have a NavigationPage does not remove the back button.

Notes:
Swapping to a Tab that does have a NavigationPage correctly updates the back-button depending on whether the current NavigationPage requires it.

Steps to Reproduce

  1. Create a new MAUI app.
  2. Replace the contents of App.xaml.cs with this:
public partial class App : Application
{
    public App()
    {
        InitializeComponent();

        var tabbedPage = new TabbedPage();
        tabbedPage.Children.Add(new ContentPage() { Title = "No Nav root" });
        tabbedPage.Children.Add(new NavigationPage(new NavContentPage()){ Title = "Has Nav root" });
        tabbedPage.Children.Add(new NavigationPage(new NavContentPage()){ Title = "Has Nav root" });
        MainPage = tabbedPage;
    }

    public class NavContentPage : ContentPage
    {
        public NavContentPage()
        {
            var button = new Button() { Text = "Push a page", VerticalOptions = LayoutOptions.Start };
            button.Clicked += (s, e) => { this.Navigation.PushAsync(new NavContentPage()); };
            Content = button;
        }
    }
}
  1. Run it on Windows.

  2. Swap to either the second or third Tab.

  3. Click the button

  4. The back button appears. This is correct.
    image

  5. Swap to the first Tab.

  6. The back-button remains. This is the bug.
    image

Link to public reproduction project repository

https://github.com/Keflon/TabbedPageNavBug

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Latest

Did you find any workaround?

No.

Relevant log output

No response

@Keflon Keflon added the t/bug Something isn't working label Apr 20, 2023
@XamlTest XamlTest added platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jun 30, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.7.0 Preview 2.0. Repro on Windows 11, not repro on Android 13.0-API33 and iOS 16.4 with below Project:
TabbedPageNavBug.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-tabbedpage TabbedPage platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants