Skip to content

fix: Custom text lost after selecting item in FluentCombobox #4314

@JamesNK

Description

@JamesNK

🐛 Bug Report

💻 Repro or Code Sample

I have a combobox. The combobox is:

  • Bound to a list of items
  • Has Immediate="true"
  • @bind-Value:after is used to manually filter items the combobox is bound to as the selected value changes

Unfortunately, this combination of behavior causes a bug after selecting an item. Entering custom text in the combobox stops working because the text value resets back to the selected item.

Recording of issue:
Image

The combobox starts working again if the items its bound to doesn't change. I think there is a bug when the items collection is changed in the value change event. It causes a new changed event which resets the combobox back to the selected value.

Source code of a comboxbox with this issue:
https://github.com/dotnet/aspire/blob/c97743e5f463312ebd2dde2ac454686cc4901a39/src/Aspire.Dashboard/Components/Dialogs/FilterDialog.razor#L39-L60

You can see this issue in any Aspire playground app, i.e. TestShop

🤔 Expected Behavior

Can enter text after selecting an item.

😯 Current Behavior

Text entered after selecting an item is lost.

💁 Possible Solution

🔦 Context

🌍 Your Environment

  • OS & Device: [e.g. MacOS, iOS, Windows, Linux] on [iPhone 7, PC]
  • Browser [e.g. Microsoft Edge, Google Chrome, Apple Safari, Mozilla FireFox]
  • .NET and Fluent UI Blazor library Version [e.g. 8.0.2 and 4.4.1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions