WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

Backbutton disappearing in WinUI 3 Desktop app with NavView and ListDetail Page when resizing the app

Open sibille opened this issue 3 years ago • 6 comments

Describe the bug

When you resize an app with a ListDetailView in a WinUI 3 NavigationView the BackButton disappears and re-appears intermittently.

  • [ ] Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

  • [ ] Can this be reproduced in the Sample App? (Either in a sample as-is or with new XAML pasted in the editor.) If so, please provide custom XAML or steps to reproduce. If not, let us know why it can't be reproduced (e.g. more complex setup, environment, dependencies, etc...)

Steps to reproduce the behavior:

  1. In the attached app (App2.sln)
  2. Go to ListDetail Page
  3. Resize the app to narrow
  4. Resize the app to wide

=> Back button disappears

Repeating step 3 and 4 makes the back button disappear and re-appear intermittently. The problem is that there are states where you cannot go back from the detail to the list or navigate backward between pages without resizing the app.

Expected behavior

The back button should not disappear

Screenshots

backButtonVisibilityError

Environment

NuGet Package(s): 
CommunityToolkit.WinUI.UI.Controls

Package Version(s): 
7.0.1

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [ ] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [ ] 2019 (version: ) 
- [x] 2019 Preview (version: Version 16.10.0 Preview 1.0)

Additional context

Add any other context about the problem here. App2.zip

sibille avatar May 12 '21 10:05 sibille

Hello sibille, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

ghost avatar May 12 '21 10:05 ghost

@sibille to clarify, this is a slightly different issue than the older UWP based one about the Back Button from here: https://github.com/windows-toolkit/WindowsCommunityToolkit/discussions/3993?

michael-hawker avatar May 12 '21 15:05 michael-hawker

Yes, this is a different new issue. It only happens on WinUI 3 (not in a UWP app). The other issue only happens when the ListDetail page is the first page and there is no backstack from the NavView. This issue happens independently on the position of the ListView in the NavView.

sibille avatar May 12 '21 16:05 sibille

Moving to the next milestone as we should be more focused on WinUI issues for that one.

michael-hawker avatar Aug 31 '21 18:08 michael-hawker

@sibille we did update the template for ListDetailView in 7.1 as part of #4197. We don't have an updated WinUI 3 build yet, but should in the future. Will be curious if that makes any changes to this issue or not.

michael-hawker avatar Aug 31 '21 18:08 michael-hawker

This still reproes with latest Template Studio builds. I worked around by changing BackButtonBehavior from Automatic to Manual to take the ListDetailsView back button out of the picture.

From https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/masterdetailsview#backbuttonbehavior, Automatic has some logic to detect when it's inside a Frame hosted in a NavigationView, and my guess is that logic has some bugs with WinUI 3 projects.

mikebattista avatar Jun 07 '22 16:06 mikebattista