Skip to content

fix: FluentSelect does not update bind-Value in MAUI application #5109

Description

🐛 Bug Report

FluentSelect does not update the @bind-Value in a .Net MAUI application.

💻 Repro or Code Sample

Create a .NET MAUI hybrid application Fluent UI template (v5.0.0-rc.4-26180.1), and paste the following into the Home.razor page:

@page "/"
@using MauiApp2.Shared.Services
@inject IFormFactor FormFactor

<PageTitle>Home</PageTitle>

<h1>Hello, world!</h1>

Welcome to your new Fluent app running on <em>@factor</em> using <em>@platform</em>.

<p>Selected EmployeeId: @EmployeeId</p>
<FluentSelect Placeholder="Select an item"
              Items="@employees"
              @bind-Value="EmployeeId"
              OptionText="@(item => $"{item.CreatedTime:yyyy-MM-dd} — {item.Name}")"
              OptionValue="@(item => item.Id)"
              Label="Employees" />

@code {
    class Employee
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public DateTime CreatedTime { get; set; }
    }

    private List<Employee> employees = new List<Employee>
    {
        new Employee { Id = "1", Name = "Luke", CreatedTime = DateTime.Now },
        new Employee { Id = "2", Name = "Sarah", CreatedTime = DateTime.Now }
    };

    private string EmployeeId { get; set; } = string.Empty;
    private int Id { get; set; }

    private string factor => FormFactor.GetFormFactor();
    private string platform => FormFactor.GetPlatform();
}

Run the Maui application and navigate to the Home page, and select an option from the FluentSelect component..

🤔 Expected Behavior

FluentSelect should behave the same as the Web version.

😯 Current Behavior

When an option is selected, the variable bound to @bind-Value is not updated.

🌍 Your Environment

  • OS & Device: Windows
  • .NET: 10
  • Fluent UI Blazor library Version: 5.0.0-rc.4-26180.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not reproducibleIssue can not be reproducedv5For the next major version

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions