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

NavigationView does not show PaneHeader or PaneTitle when IsPaneToggleButtonVisible is false #1005

Closed
knightmeister opened this issue Jul 7, 2019 · 4 comments · Fixed by #1083
Assignees
Labels
area-NavigationView NavView control bug Something isn't working team-Controls Issue for the Controls team working on it

Comments

@knightmeister
Copy link

Describe the bug
The NavigationView does not show PaneHeader or PaneTitle content when IsPaneToggleButtonVisible is false and the hamburger icon is not shown.

Steps to reproduce the bug
Set a PaneHeader or PaneTitle content and set IsPaneToggleButtonVisible to false. The content will not be shown.

Expected behavior
If header or title is set, it should be shown regardless of the visibility of the pane toggle button. For my particular scenario, I want the UX of my app such that the navigation view cannot be manually collapsed so the pane toggle button isn't shown, but I'd like to show header content.

Screenshots
N/A

Version Info
Seen on both 1903 (Desktop) and Nuget 2.1.190606001

NuGet package version:
2.1.190606001

@msft-github-bot msft-github-bot added this to Needs triage in Controls Triage Jul 7, 2019
@YuliKl YuliKl added area-NavigationView NavView control bug Something isn't working labels Jul 8, 2019
@RBrid
Copy link
Contributor

RBrid commented Jul 9, 2019

@YuliKl, this looks like all By Design to me based on what I'm seeing the NavigationView's control template:

  1. The PaneTitle is actually part of toggle button's content:
<Button
    x:Name="TogglePaneButton"
    Style="{TemplateBinding PaneToggleButtonStyle}"
    AutomationProperties.LandmarkType="Navigation"
    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneToggleButtonVisibility}"
    VerticalAlignment="Top">
    <TextBlock
        x:Name="PaneTitleTextBlock" 
        Grid.Column="0"
        Text="{TemplateBinding PaneTitle}"
        HorizontalAlignment="Left"
        VerticalAlignment="Center"
        Style="{StaticResource NavigationViewItemHeaderTextStyle}"/>
</Button>
  1. When IsPaneToggleButtonVisible is set to False, we go into the TogglePaneButtonCollapsed state which squeezes the height of the row containing the PaneHeader to 4px.
<VisualStateGroup x:Name="TogglePaneGroup">
  <VisualState x:Name="TogglePaneButtonVisible" />
  <VisualState x:Name="TogglePaneButtonCollapsed">
    <VisualState.Setters>
      <Setter Target="PaneContentGridToggleButtonRow.Height" Value="4" />
    </VisualState.Setters>
  </VisualState>
</VisualStateGroup>

We can't change this lightly. I think it'll need some spec'ing if re-templating the control (by the customer) is not the solution here.

@YuliKl
Copy link

YuliKl commented Jul 9, 2019

@RBrid, I believe the implementation does not correctly reflect the intent of the design. The hamburger button and the pane title are conceptually independent elements (that have some deliberate visual alignment). Without knowing the implementation details, I see no reason to prevent apps from showing the pane title while hiding the hamburger button. The current implementation details may require significant refactoring to fix, but that doesn't change my view that the current behavior is a bug.

@jevansaks
Copy link
Member

Giving to @RBrid since he's in that code recently, but if this is hard to fix then unassign and we'll find someone else while @RBrid is on vacation.

@msft-github-bot
Copy link
Collaborator

🎉This issue was addressed in #1083, which has now been successfully released as Microsoft.UI.Xaml v2.2.190731001-prerelease.:tada:

Handy links:

@jevansaks jevansaks added the team-Controls Issue for the Controls team label Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NavigationView NavView control bug Something isn't working team-Controls Issue for the Controls team working on it
Projects
No open projects
5 participants