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

Cannot enter a custom value in editable ComboBox #8242

Open
jbrianceau opened this issue Mar 1, 2023 · 1 comment
Open

Cannot enter a custom value in editable ComboBox #8242

jbrianceau opened this issue Mar 1, 2023 · 1 comment
Labels
area-ComboBox bug Something isn't working team-Controls Issue for the Controls team

Comments

@jbrianceau
Copy link
Member

jbrianceau commented Mar 1, 2023

Describe the bug

When using a ComboBox control having it's IsEditable property set to True and a predefined list of items, it is not possible for the user to enter a custom value which is a prefix of one of the items available in the list.

For instance, with:

<ComboBox IsEditable="True">
    <ComboBoxItem>12</ComboBoxItem>
    <ComboBoxItem>34</ComboBoxItem>
    <ComboBoxItem>56</ComboBoxItem>
    <ComboBoxItem>78</ComboBoxItem>
    <ComboBoxItem>79</ComboBoxItem>
</ComboBox>

It's possible for the user to set the ComboBox value to 2, 4, 6 but not possible to set it to 1, 3, 5, 7

Same issue with letters:

<ComboBox IsEditable="True">
    <ComboBoxItem>ab</ComboBoxItem>
    <ComboBoxItem>cd</ComboBoxItem>
    <ComboBoxItem>ef</ComboBoxItem>
    <ComboBoxItem>gh</ComboBoxItem>
    <ComboBoxItem>gi</ComboBoxItem>
</ComboBox>

It's possible for the user to set the ComboBox value to b, d, f but not possible to set it to a, c, e, g

Steps to reproduce the bug

  1. Create a WinUI 3 project
  2. Add the following snippet to MainWindow.xaml
<ComboBox IsEditable="True">
    <ComboBoxItem>12</ComboBoxItem>
    <ComboBoxItem>34</ComboBoxItem>
    <ComboBoxItem>56</ComboBoxItem>
    <ComboBoxItem>78</ComboBoxItem>
    <ComboBoxItem>79</ComboBoxItem>
</ComboBox>
  1. Run the project
  2. Try to set the ComboBox value to 1 for instance
  3. Navigate away from the ComboBox

Note: it's also possible to get a repro with "WinUI 2 Gallery" and "WinUI 3 Gallery" apps

Expected behavior

I would expect that the ComboBox keeps the value entered by the user (1) and does not change it to 12 automatically.

Screenshots

  • Custom project
    WinUI3ComboBox

  • WinUI 3 Gallery
    WinUI3ComboBox2

NuGet package version

Windows App SDK 1.2.4: 1.2.230217.4

Packaging type

No response

Windows version

Windows 11 version 22H2 (22621, 2022 Update), Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

@gabbybilka gabbybilka transferred this issue from microsoft/WindowsAppSDK Mar 2, 2023
@gabbybilka gabbybilka added area-ComboBox team-Controls Issue for the Controls team labels Mar 2, 2023
@duncanmacmichael duncanmacmichael added the bug Something isn't working label Oct 23, 2023
@ekdahl
Copy link

ekdahl commented Mar 6, 2024

Still the same behavior with Windows App SDK 1.5.240227000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ComboBox bug Something isn't working team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

4 participants