Skip to content

NavigationView: PaneFooter containing NavigationViewItem crashes app when navigating focus via TAB to Settings item (Regression) #3445

@Felix-Dev

Description

@Felix-Dev

Describe the bug
When putting a NavigationViewItem inside the NavigationView.PaneFooter area as the last item and then moving focus to the NavigationView's in-built Settings item via TAB, the app crashes:

<muxc:NavigationView>
    <muxc:NavigationView.MenuItems>
        <muxc:NavigationViewItem Icon="Home" Content="Home"/>
    </muxc:NavigationView.MenuItems>

    <muxc:NavigationView.PaneFooter>
        <muxc:NavigationViewItem>
            <muxc:NavigationViewItem.Content>
                <StackPanel Orientation="Horizontal">
                    <PersonPicture Width="20" Height="20" />
                    <TextBlock Text="Account" Margin="10,0,0,0" />
                </StackPanel>
            </muxc:NavigationViewItem.Content>
        </muxc:NavigationViewItem>
    </muxc:NavigationView.PaneFooter>
</muxc:NavigationView>

navview-regression-focus-crash

Note that for the crash to happen, an existing NavigationViewItem needs to be selected when moving focus. This is a regression which first occurs in WinUI 2.5.0-prerelease.200812001 and is probably caused by PR #1997.

Expected behavior
App should not crash and focus should move to Settings item.

NuGet package version:

  • Microsoft.UI.Xaml 2.5.0-prerelease.200812001
  • Microsoft.UI.Xaml v2.5.0-prerelease.200923002

Additional context
I would like to take a look at this. I might have to write an interaction test though and I'm currently blocked on PR #3359. If that PR will take a while to be merged, and a fix for this issue needs to get out real fast (depending on WinUI's 2.5 release plan) then someone else without my interaction test issues is probably a better choice to work on this. @StephenLPeters to comment (seems like unrelated test pipeline issue(s) need to be resolved first for that PR to be merged).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions