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

NavigationViewItem content clipping regression in 2.4.x #2541

Closed
mfeingol opened this issue May 24, 2020 · 4 comments · Fixed by #2717
Closed

NavigationViewItem content clipping regression in 2.4.x #2541

mfeingol opened this issue May 24, 2020 · 4 comments · Fixed by #2717
Labels
area-NavigationView NavView control team-Controls Issue for the Controls team
Milestone

Comments

@mfeingol
Copy link

mfeingol commented May 24, 2020

Describe the bug

NavigationViewItem clips its internal contents in 2.4.x much more than 2.3.x. This makes it very difficult to render custom elements in NavigationViewItem alongside standard NavigationViewItem icons. The problem is visible when the NavigationViewItem is in collapsed mode.

The following are screenshots of the NavigationView's PaneFooter:

2.3.2:

2 3 2

2.4.2:

2 4 2

Steps to reproduce the bug

Steps to reproduce the behavior: use this XAML as a NavigationView footer, and compare results between 2.3.x and 2.4.x:

            <ui:NavigationView.PaneFooter>
                <ui:NavigationViewItem>
                    <StackPanel Orientation="Horizontal" Margin="-6,0,0,0">
                        <ui:PersonPicture PreferSmallImage="True" Height="24">
                            <ui:PersonPicture.ProfilePicture>
                                <BitmapImage UriSource="some source" />
                            </ui:PersonPicture.ProfilePicture>
                        </ui:PersonPicture>
                        <TextBlock Margin="6,0,0,0" VerticalAlignment="Center" Text="some text" />
                    </StackPanel>
                </ui:NavigationViewItem>
            </ui:NavigationView.PaneFooter>

Expected behavior

Clipping behavior in 2.3.x seems much more sane.

Screenshots
See above

Version Info
Comparing 2.3.200213001 and 2.4.2.

Windows 10 version Saw the problem?
Insider Build (19041) Yes
Device form factor Saw the problem?
Desktop Yes
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label May 24, 2020
@ranjeshj ranjeshj added area-NavigationView NavView control team-Controls Issue for the Controls team labels May 27, 2020
@ranjeshj
Copy link
Contributor

@mfeingol is this the same as seen in this issue ? Does it repro with items only in the pane footer and no other items ?

@ranjeshj ranjeshj added needs-author-feedback Asked author to supply more information. needs-cherrypicktorelease PR tagged for cherry-pick to the current release branch (but not yet picked) and removed needs-triage Issue needs to be triaged by the area owners labels May 27, 2020
@mfeingol
Copy link
Author

@ranjeshj: not sure if it's the same issue.

It repros with with items under NavigationView.MenuItems as well as items under NavigationView.PaneFooter.

@msft-github-bot msft-github-bot added needs-triage Issue needs to be triaged by the area owners and removed needs-author-feedback Asked author to supply more information. labels May 27, 2020
@ranjeshj ranjeshj removed the needs-triage Issue needs to be triaged by the area owners label May 27, 2020
@ranjeshj ranjeshj added this to the WinUI 2.5 milestone May 27, 2020
@marcelwgn
Copy link
Collaborator

The root issue is that the we now enforce a margin for the Content presenter, which results in 16px to the right of the content to allow the Expand chevron for hierarchical NavigationViewItems to always be completely visible and not block the NavigationViewItems content.

The question would be: How do we enforce that the expand/collapse chevron has enough space while also not clipping the content of the NavViewItems in Compact.

@Felix-Dev
Copy link
Contributor

As the expand/collapse chevron is not shown in compact mode with pane closed, we can utilize the work done in PR #2342 to restore the ContentPresenter margin to its value seen in WinUI 2.3 (and below)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NavigationView NavView control team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants