Open Closed

Dropdown Extension Property in User Management Duplicates Selected Values #8895


User avatar
0
markusbergkvist created
  • ABP Framework version: v9.0.5

  • UI Type: Blazor Server

  • Database System: EF Core (SQL Server)

  • Tiered (for MVC) or Auth Server Separated (for Angular): no

  • Exception message and full stack trace:

  • Steps to reproduce the issue:

Create a new ABP Blazor Server application.
Create a simple entity to use for the extension property.
Configure the extra property for IdentityUser in ExtensionConfigurator.
Override the UserManagement razor component with the source code from the module.
Run the application and navigate to the Identity Users management page.
Open the Create or Edit User modal.
Select an option from the dropdown field.
Click outside of the field to lose focus.
Click back into the field and select another option.
The selected value does not clear and is duplicated/added to each time.

Is there a known issue with dropdown extension properties in Blazor Server, and how can we ensure the selection clears correctly? Could this be related to overriding the UserManagement component? Looking at the code for LookupExtensionProperty.razor.cs we think it could be related to how items are added when parameters are set.

    protected override void OnParametersSet()
    {
        var value = Entity.GetProperty(PropertyInfo.Name);
        var text = Entity.GetProperty(TextPropertyName);
        if (value != null && text != null)
        {
            lookupItems.Add(new SelectItem
            {
                Text = Entity.GetProperty(TextPropertyName)!.ToString()!,
                Value = value
            });
        }
    }

Screenshot 2025-03-03 at 13.05.38.png

Thanks


1 Answer(s)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08