question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AutoSuggestBox menu is zero-height

See original GitHub issue

Describe the bug

The suggestion menu of a WinUI AutoSuggestBox appears to be near zero height, even when list of suggestions is not empty.

Steps to reproduce the bug

  1. Install and open XAML Studio.
  2. Copy the following XAML into the editor:
<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Padding="40">
        <AutoSuggestBox>
            <x:String>Howdy</x:String>
            <x:String>Suggestion</x:String>
            <x:String>Another suggestion</x:String>
        </AutoSuggestBox>
    </Grid>
</Page>
  1. Type some text into the box. Observe that a tiny sliver of the suggestions menu appears.

Expected behavior

The suggestions menu should show the current suggestions (AutoSuggestBox.Items).

Screenshots

image

NuGet package version

Microsoft.UI.Xaml 2.7.0

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

Windows 10 (20H2): Build 19042

Additional context

XAML Studio still uses WinUI 2.3, but I initially ran into this issue with an Uno UWP app using WinUI 2.7 and was able to repro with WinUI 2.8.0-prerelease.220118001.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RealTommyKleincommented, Mar 15, 2022

I can reproduce using the given markup.

To me it looks like AutoSuggestBox doesn’t pass Items to ListView (only passes ItemsSource), so directly add items in <AutoSuggestBox> doesn’t work.

This is what I found as well. This is unrelated to Binding/x:Bind, setting ItemsSource works but Items doesn’t. @ojhad here’s a repro in a VS project, where the project’s markup uses Items which doesn’t work, but clicking the Button sets ItemsSource in code-behind which then works: AutoSuggestBoxRepro.zip . Note that Binding/x:Bind is never used.

1reaction
yoshiaskcommented, Mar 15, 2022

@ojhad I’m targeting v2004 / b19041.

Read more comments on GitHub >

github_iconTop Results From Across the Web

zeroheight - zeroheight
zeroheight creates a central hub for designers, engineers, product and marketing teams. Connect everyone with your design system.
Read more >
AutoSuggestBox Class (Windows.UI.Xaml.Controls)
Represents a text control that makes suggestions to users as they enter text using a keyboard or pen (using ink and handwriting recognition)....
Read more >
Best Zeroheight Alternatives & Competitors
Compare the best Zeroheight alternatives in 2023. Explore user reviews, ratings, and pricing of alternatives and competitors to Zeroheight.
Read more >
Responsive Web | PDF | Windows 10 | Mobile App
Press the Windows key to open the Start menu, then show all apps. ... Predictive text entry Auto-suggest box Saves users time when...
Read more >
Zeroheight and Figma
Insert any Figma Styles and Components into your Styleguides in zeroheight. Go to the styleguides tab in zeroheight: Select the Styleguide from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found