Skip to content

AutoSuggestBox in NavigationView does not collapse when hidden #11660

Open

Description

@Suriman

Current behavior

If the AutoSuggestBox is included in a NavigationView pane and the visibility of the AutoSuggestBox is controlled by a binding, then the space it occupies does not collapse when it disappears. Additionally if the NavigationView pane collapses, the search icon appears indicating a field that does not appear when it is expanded.

Expected behavior

When the AutoSuggestBox collapses the space it occupies also collapses and when the NavigationView pane collaapses no search icon is shown.

How to reproduce it (as minimally and precisely as possible)

Open the attached solution and compile it.
Execute it in any head.
In the attached solution you can show and hide the AutoSuggestBox using a ToogleButton and if the NavigationView pane is collapsed without the AutoSuggestBox you can see the search icon.

Workaround

No known workaround.

Works on UWP/WinUI

No

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

4.7.44

Affected platforms

WebAssembly, Android, Skia (WPF), Windows

IDE

Visual Studio 2022

IDE version

17.5.1

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    difficulty/tbd
    kind/bug
    triage/untriaged
    on Mar 13, 2023
  2. Youssef1313 commented on Mar 13, 2023

    @Youssef1313
    Member

    @Suriman I guess you forgot to upload the repro?

  3. added
    platform/all
    area/navigationview 🧭
    area/autosuggestbox
    on Mar 13, 2023
  4. Suriman commented on Mar 13, 2023

    @Suriman
    Author

    @Youssef1313 I can't upload it because of a error in GitHub. I have sent it to Sasha by Teams.

  5. removed
    triage/untriaged
    on Mar 14, 2023
  6. ADD-David-Antolin commented on Mar 16, 2023

    @ADD-David-Antolin

    Removing height attribute here seems to do the trick.

  7. changed the title [-]The AutoSuggestBox in NavigationView does not collapse when hidden.[/-] [+]`AutoSuggestBox` in `NavigationView` does not collapse when hidden[/+] on Sep 11, 2023
  8. added
    project/layout 🧱
    difficulty/medium 🤔
    and removed
    difficulty/tbd
    on Sep 11, 2023
  9. ADD-Noureddine-Maachi commented on May 27, 2025

    @ADD-Noureddine-Maachi

    Any updates about this?

  10. added theissue type on Jun 20, 2025
  11. added
    triage/potentially-fixed
    on Apr 8, 2026
  12. MartinZikmund commented on Apr 8, 2026

    @MartinZikmund
    Member

    Repro generator

    Runtime test(s) added in branch dev/mazi/repro/11660:

    • src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_NavigationView.cs → When_AutoSuggestBox_Collapsed_Space_Should_Collapse

    ⚠️ The test(s) pass on current master — the bug may have been fixed since the issue was filed. The test creates a NavigationView with an AutoSuggestBox, sets Visibility=Collapsed, and verifies the AutoSuggestBox takes zero height. The original issue also mentions a search icon appearing in the collapsed pane state — that aspect is visual and not covered by this test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/autosuggestboxarea/navigationview 🧭difficulty/medium 🤔has-repro-branchkind/bugplatform/allproject/layout 🧱triage/potentially-fixed

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions