Skip to content

AutoCompleteBox: Setting MinimumPrefixLength to 0 causes dropdown to open when control is shown for the first time #1554

Closed
@MarchingCube

Description

@MarchingCube

AutoCompleteBox with MinimumPrefixLength opens on it's own when show for the first time. Simplest repro is setting MinimumPrefixLength to 0 for any of the controls in AutoCompleteBoxPage.xaml.

In example below I have set it to all controls, which opens dropdowns for them all. And it requires a click per each to close them.

autocompletebox

Sample below simply wraps AutoCompleteBox in a Expander. For the first time Expander is opened the dropdown will show, subsequent opens do not trigger a dropdown open.

<ListBox Items="{Binding TestItems}">
    <ListBox.ItemTemplate>
      <DataTemplate>
        <Expander Header="Test Element">
            <AutoCompleteBox Items="{Binding CompleteItems}" MinimumPrefixLength="0" FilterMode="ContainsOrdinal"/>
        </Expander>
      </DataTemplate>
    </ListBox.ItemTemplate>
  </ListBox>

autocompletebox_2

cc: @sdoroff since he ported this control from Silverlight and maybe can shed some light on this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions