Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ac9129a
Add FluentAutocomplete component with basic functionality and documen…
dvoituron Jan 23, 2026
0bb01c8
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron Jan 24, 2026
6425745
Enhance FluentAutocomplete with selected items rendering and input ch…
dvoituron Jan 24, 2026
5a35040
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron Mar 4, 2026
b08171a
Format Autocomplete component for better readability
dvoituron Mar 4, 2026
0494f71
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron Mar 10, 2026
79dbc48
feat: enhance FluentAutocomplete with search functionality and multip…
dvoituron Mar 10, 2026
5d5540c
fix: refactor event handling in FluentAutocomplete for improved text …
dvoituron Mar 10, 2026
bfe1206
fix: add missing OptionValue binding in FluentListbox for proper item…
dvoituron Mar 10, 2026
784cbed
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron Mar 19, 2026
e5e74c5
Refactored FluentAutocomplete to use internal lists for selected and …
dvoituron Mar 19, 2026
9a94856
Enhance ListboxExtended to manage pending selected options changes an…
dvoituron Mar 20, 2026
95845df
Add FluentAutocomplete component and initialize method for keyboard n…
dvoituron Mar 20, 2026
706c118
Refactor FluentAutocomplete to integrate DropdownOption and enhance k…
dvoituron Mar 20, 2026
acddfdf
Refactor keyboard navigation in FluentAutocomplete to use hovered att…
dvoituron Mar 20, 2026
8ecaa5d
Fix popover handling in FluentAutocomplete to ensure proper error han…
dvoituron Mar 20, 2026
406f211
Enhance FluentAutocomplete and FluentListbox to improve popover handl…
dvoituron Mar 20, 2026
8faffb9
Add progress indicator to FluentAutocomplete and handle keyboard inpu…
dvoituron Mar 20, 2026
4c68656
Enhance documentation in FluentAutocomplete by adding summaries for e…
dvoituron Mar 25, 2026
9c0f63b
Refactor FluentAutocomplete to use TextInput type for input handling
dvoituron Mar 25, 2026
8ab3694
Refactor FluentAutocomplete to improve input handling and display fil…
dvoituron Mar 25, 2026
9eeb5e6
Enhance FluentIcon and FluentAutocomplete to support click event prop…
dvoituron Mar 25, 2026
2fbc84b
Enhance FluentAutocomplete to manage input focus on popup close and a…
dvoituron Mar 25, 2026
65fc4d2
Enhance FluentAutocomplete to improve option display logic and input …
dvoituron Mar 25, 2026
f3d5464
Refactor FluentAutocomplete to improve progress indicator visibility …
dvoituron Mar 25, 2026
84fb5ba
Enhance FluentAutocomplete to add clear selection functionality and u…
dvoituron Mar 25, 2026
6f3ff63
Enhance FluentAutocomplete to improve Enter key handling for option s…
dvoituron Mar 25, 2026
ea62ec5
Enhance FluentAutocomplete to add MaxAutoHeight functionality for sel…
dvoituron Mar 25, 2026
88196f1
Refactor FluentAutocomplete CSS to enhance MaxAutoHeight layout and i…
dvoituron Mar 26, 2026
d210075
Enhance FluentAutocomplete to add MaxSelectedWidth functionality for …
dvoituron Mar 26, 2026
2f7f5a6
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron Mar 31, 2026
8797dc2
Enhance FluentAutocomplete with Placeholder and InputAppearance param…
dvoituron Mar 31, 2026
fe34483
Enhance FluentAutocomplete option template with avatar and name displ…
dvoituron Mar 31, 2026
bda2fc6
Enhance FluentAutocomplete with customizable icons for Clear and Sear…
dvoituron Mar 31, 2026
19eff31
Refactor FluentAutocomplete examples to streamline code and enhance d…
dvoituron Mar 31, 2026
c7afd8c
Add FluentAutocomplete documentation with keyboard interaction detail…
dvoituron Mar 31, 2026
aecb51f
Enhance FluentAutocomplete to detect wrapped items and adjust layout …
dvoituron Apr 1, 2026
fffd1e0
Update FluentAutocomplete to allow dynamic MaxAutoHeight and adjust I…
dvoituron Apr 1, 2026
77029d3
Refactor ItemsComparer usage in FluentAutocomplete to simplify item c…
dvoituron Apr 1, 2026
ec409ed
Enhance FluentAutocomplete with ShowDismiss option and update styles …
dvoituron Apr 2, 2026
2ff773e
Add documentation and example for single item selection in FluentAuto…
dvoituron Apr 2, 2026
564010d
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron Apr 2, 2026
cde18e0
Refactor item comparison logic in FluentAutocomplete and add example …
dvoituron Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ indent_size = 4
end_of_line = lf

[*.{razor,cshtml}]
indent_size = 4
indent_style = space
charset = utf-8-bom

[*.{cs,vb}]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@page "/Lists/Autocomplete/Debug/Comparer"

<div>Selected: <b>@string.Join("; ", Selected.Select(x => x.Name))</b></div>

<FluentAutocomplete TOption="MyUser"
TValue="int"
Width="100%"
Label="Name"
Placeholder="Name"
OptionText="(option) => option.Name"
OptionValue="(option) => option.UserId"
OptionSelectedComparer="MyComparer.Instance"
OnOptionsSearch="@OnSearchAsync"
@bind-SelectedItems="@Selected" />

@code
{
IEnumerable<MyUser> Selected { get; set; } = [];

Task OnSearchAsync(OptionsSearchEventArgs<MyUser> e)
{
e.Items =
[
new MyUser
{
UserId = 1,
Name = "Marvin Klein"
},
new MyUser
{
UserId = 2,
Name = "Denis Voituron"
},
];

return Task.CompletedTask;
}

class MyUser
{
public int UserId { get; set; }
public string Name { get; set; } = string.Empty;
}

class MyComparer : IEqualityComparer<MyUser>
{
public static readonly MyComparer Instance = new MyComparer();

public bool Equals(MyUser? x, MyUser? y)
{
if (ReferenceEquals(x, y))
{
return true;
}

if (x is null || y is null)
{
return false;
}

return x.UserId == y.UserId;
}

public int GetHashCode(MyUser obj) => obj.UserId.GetHashCode();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@using static FluentUI.Demo.SampleData.Olympics2024

<div>Selected: <b>@string.Join("; ", SelectedCountries.Select(c => c.Name))</b></div>
<div>Search Text: <b>@SearchText</b></div>

<FluentAutocomplete TOption="Country"
TValue="string"
Width="100%"
Label="Select countries"
Placeholder="Type to search..."
ShowProgressIndicator="@ShowProgressIndicator"
MaxAutoHeight="@((MaxAutoHeight) ? "unset" : null)"
OnOptionsSearch="@OnSearchAsync"
OptionText="@(item => item.Name)"
MaxSelectedWidth="@(MaxSelectedWidth ? "40px" : null)"
ShowDismiss="@ShowDismiss"
@bind-Value="@SearchText"
@bind-SelectedItems="@SelectedCountries">
<OptionTemplate>
<FluentStack Style="pointer-events: none;" VerticalAlignment="VerticalAlignment.Center">
<FluentAvatar Image="@context.Flag()"
Name="@context.Name"
Size="AvatarSize.Size20" />
<FluentText Margin="@Margin.Left4">
@context.Name
</FluentText>
</FluentStack>
</OptionTemplate>
</FluentAutocomplete>

<FluentStack Orientation="Orientation.Vertical">
<FluentSwitch @bind-Value="@ShowProgressIndicator" Label="Show progress indicator" />
<FluentSwitch @bind-Value="@MaxAutoHeight" Label="Auto height" />
<FluentSwitch @bind-Value="@MaxSelectedWidth" Label="Set a max selected width (40px)" />
<FluentSwitch @bind-Value="@ShowDismiss" Label="Show search or dismiss button" />
</FluentStack>

@code
{
bool ShowProgressIndicator { get; set; }
bool MaxAutoHeight { get; set; }
bool MaxSelectedWidth { get; set; }
bool ShowDismiss { get; set; } = true;
string? SearchText { get; set; }
IEnumerable<Country> SelectedCountries { get; set; } = [];

async Task OnSearchAsync(OptionsSearchEventArgs<Country> e)
{
if (ShowProgressIndicator)
{
await Task.Delay(500); // Simulate async search
}

e.Items = Countries.Where(i => i.Name.StartsWith(e.Text, StringComparison.OrdinalIgnoreCase))
.OrderBy(i => i.Name);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@using static FluentUI.Demo.SampleData.Olympics2024

<div>Selected: <b>@string.Join("; ", SelectedCountries.Select(c => c.Name))</b></div>

<FluentAutocomplete TOption="Country"
TValue="string"
Width="100%"
Label="Select countries"
Placeholder="Type to search..."
OnOptionsSearch="@OnSearchAsync"
OptionText="@(item => item.Name)"
OptionDisabled="@(e => e.Code == "au")"
@bind-SelectedItems="@SelectedCountries" />
@code
{
IEnumerable<Country> SelectedCountries { get; set; } = [];

Task OnSearchAsync(OptionsSearchEventArgs<Country> e)
{
e.Items = Countries.Where(i => i.Name.StartsWith(e.Text, StringComparison.OrdinalIgnoreCase))
.OrderBy(i => i.Name);

return Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@using static FluentUI.Demo.SampleData.Olympics2024

<div>Selected: <b>@string.Join("; ", SelectedCountries.Select(c => c.Name))</b></div>

<FluentAutocomplete TOption="Country"
TValue="string"
Label="Select a country"
Multiple="false"
Placeholder="Type to search..."
OnOptionsSearch="@OnSearchAsync"
OptionText="@(item => item.Name)"
OptionDisabled="@(e => e.Code == "au")"
@bind-SelectedItems="@SelectedCountries" />
@code
{
IEnumerable<Country> SelectedCountries { get; set; } = [];

Task OnSearchAsync(OptionsSearchEventArgs<Country> e)
{
e.Items = Countries.Where(i => i.Name.StartsWith(e.Text, StringComparison.OrdinalIgnoreCase))
.OrderBy(i => i.Name);

return Task.CompletedTask;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Autocomplete
route: /Lists/Autocomplete
---

# Autocomplete

An **Autocomplete** component is a text input that provides real-time suggestions as the user types.
It combines a free-text input with a filtered list of options, allowing users to either select from the suggestions or type their own value.

It is particularly useful when the list of options is large, as the user can narrow down choices without scrolling through all available items.

## Keyboard interaction

| Key | Behavior |
|---|---|
| **Type text** | Filters the list of options and triggers the `OnSearchAsync` method to fetch matching results. |
| **Arrow Down / Arrow Up** | Opens the suggestion list and navigates through the items in the suggestion list. |
| **Enter** | Selects the currently highlighted item. |
| **Backspace** | Deletes the most recently selected item (in multi-select mode). |
| **Escape** | Closes the suggestion list without selecting an item. |

<br /><br />

## Default

A basic autocomplete that filters a list of countries as the user types.
Multiple items can be selected, and one option is disabled (`OptionDisabled`).

{{ AutocompleteDefault }}

## Single item (Multiple=false)

Set the `Multiple` parameter to `false` to restrict the selection to a single item.
In this mode, the selected value replaces the input text and no tags are displayed.

{{ AutocompleteMultipleFalse }}

## Customized options

Demonstrates advanced features: a custom `OptionTemplate` to render each option with a flag, a progress indicator during async search,
a configurable max dropdown height, and a max width for selected items.

{{ AutocompleteCustomized }}

## API FluentAutocomplete

{{ API Type=FluentAutocomplete<string,string> }}

## Migrating to v5

TODO

Loading
Loading