-
Notifications
You must be signed in to change notification settings - Fork 468
[dev-v5] Add FluentAutocomplete #4662
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
Merged
Merged
Changes from all commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
ac9129a
Add FluentAutocomplete component with basic functionality and documen…
dvoituron 0bb01c8
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron 6425745
Enhance FluentAutocomplete with selected items rendering and input ch…
dvoituron 5a35040
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron b08171a
Format Autocomplete component for better readability
dvoituron 0494f71
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron 79dbc48
feat: enhance FluentAutocomplete with search functionality and multip…
dvoituron 5d5540c
fix: refactor event handling in FluentAutocomplete for improved text …
dvoituron bfe1206
fix: add missing OptionValue binding in FluentListbox for proper item…
dvoituron 784cbed
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron e5e74c5
Refactored FluentAutocomplete to use internal lists for selected and …
dvoituron 9a94856
Enhance ListboxExtended to manage pending selected options changes an…
dvoituron 95845df
Add FluentAutocomplete component and initialize method for keyboard n…
dvoituron 706c118
Refactor FluentAutocomplete to integrate DropdownOption and enhance k…
dvoituron acddfdf
Refactor keyboard navigation in FluentAutocomplete to use hovered att…
dvoituron 8ecaa5d
Fix popover handling in FluentAutocomplete to ensure proper error han…
dvoituron 406f211
Enhance FluentAutocomplete and FluentListbox to improve popover handl…
dvoituron 8faffb9
Add progress indicator to FluentAutocomplete and handle keyboard inpu…
dvoituron 4c68656
Enhance documentation in FluentAutocomplete by adding summaries for e…
dvoituron 9c0f63b
Refactor FluentAutocomplete to use TextInput type for input handling
dvoituron 8ab3694
Refactor FluentAutocomplete to improve input handling and display fil…
dvoituron 9eeb5e6
Enhance FluentIcon and FluentAutocomplete to support click event prop…
dvoituron 2fbc84b
Enhance FluentAutocomplete to manage input focus on popup close and a…
dvoituron 65fc4d2
Enhance FluentAutocomplete to improve option display logic and input …
dvoituron f3d5464
Refactor FluentAutocomplete to improve progress indicator visibility …
dvoituron 84fb5ba
Enhance FluentAutocomplete to add clear selection functionality and u…
dvoituron 6f3ff63
Enhance FluentAutocomplete to improve Enter key handling for option s…
dvoituron ea62ec5
Enhance FluentAutocomplete to add MaxAutoHeight functionality for sel…
dvoituron 88196f1
Refactor FluentAutocomplete CSS to enhance MaxAutoHeight layout and i…
dvoituron d210075
Enhance FluentAutocomplete to add MaxSelectedWidth functionality for …
dvoituron 2f7f5a6
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron 8797dc2
Enhance FluentAutocomplete with Placeholder and InputAppearance param…
dvoituron fe34483
Enhance FluentAutocomplete option template with avatar and name displ…
dvoituron bda2fc6
Enhance FluentAutocomplete with customizable icons for Clear and Sear…
dvoituron 19eff31
Refactor FluentAutocomplete examples to streamline code and enhance d…
dvoituron c7afd8c
Add FluentAutocomplete documentation with keyboard interaction detail…
dvoituron aecb51f
Enhance FluentAutocomplete to detect wrapped items and adjust layout …
dvoituron fffd1e0
Update FluentAutocomplete to allow dynamic MaxAutoHeight and adjust I…
dvoituron 77029d3
Refactor ItemsComparer usage in FluentAutocomplete to simplify item c…
dvoituron ec409ed
Enhance FluentAutocomplete with ShowDismiss option and update styles …
dvoituron 2ff773e
Add documentation and example for single item selection in FluentAuto…
dvoituron 564010d
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
dvoituron cde18e0
Refactor item comparison logic in FluentAutocomplete and add example …
dvoituron 853fd78
Enhance option selection logic in FluentAutocomplete
dvoituron 45865b2
Enhance FluentAutocomplete to support single selection with 'alone' a…
dvoituron 8e19372
Refactor FluentAutocomplete to support single selection mode and upda…
dvoituron b016de6
Adjust FluentAutocomplete styles for improved layout and spacing in s…
dvoituron b5386f5
Enhance FluentAutocomplete component with multiple selection support …
dvoituron b6fd07b
Add header and footer content support to FluentAutocomplete component
dvoituron 48e83d0
Refactor FluentAutocomplete component to conditionally display progre…
dvoituron 215f155
Add maximum selected options feature to FluentAutocomplete component
dvoituron 1d31f71
Enhance FluentAutocomplete component with improved item filtering and…
dvoituron b49f52b
Add MaximumOptionsSearch property and set max-height for FluentAutoco…
dvoituron f1ee645
Fix item removal logic in FluentAutocomplete component to use compare…
dvoituron a5df965
Enhance FluentAutocomplete component with custom option templates and…
dvoituron aa576b0
Fix default unit tests
dvoituron 39c4f0e
Add tests for FluentAutocomplete component and fix max-height style h…
dvoituron e420c6a
Add tests for FluentAutocomplete component to verify item removal and…
dvoituron b769c38
Add test for FluentAutocomplete component to verify progress indicato…
dvoituron e8625a9
Add tests for FluentAutocomplete component to verify popover closes o…
dvoituron 5a2ea30
Refactor FluentAutocomplete methods to internal visibility and enhanc…
dvoituron 271af5e
Add test for FluentAutocomplete component to verify no action on null…
dvoituron ee25613
Update FluentAutocomplete documentation to clarify default comparison…
dvoituron 17ad830
Add migration documentation for FluentAutocomplete component in v5
dvoituron 6bac17f
Fix formatting in FluentListBase.razor for option template rendering
dvoituron 6cedcc9
Merge remote-tracking branch 'origin/dev-v5' into users/dvoituron/dev…
dvoituron 613b5b5
Fix PR comments
dvoituron c06d608
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
vnbaaij 86cf3da
Fix doc
dvoituron 63e321b
Merge branch 'dev-v5' into users/dvoituron/dev-v5/autocomplete
vnbaaij File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
...Demo.Client/Documentation/Components/List/Autocomplete/DebugPages/AutocompleteDebug.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| @page "/Lists/Autocomplete/Debug" | ||
|
|
||
| @using static FluentUI.Demo.SampleData.Olympics2024 | ||
|
|
||
| <div style="margin: 24px;"> | ||
|
|
||
| <div>Selected items: <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" | ||
| Items="@Countries" | ||
| OptionText="@(item => item.Name)" | ||
| MaxSelectedWidth="@(MaxSelectedWidth ? "40px" : null)" | ||
| ShowDismiss="@ShowDismiss" | ||
| Multiple="@Multiple" | ||
| MaximumSelectedOptions="@(SetMaximumSelectedOptions ? 4 : (int?)null)" | ||
| @bind-Value="@SearchText" | ||
| @bind-SelectedItems="@SelectedCountries"> | ||
|
|
||
| @* Drop-down item template *@ | ||
| <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> | ||
|
|
||
| @* Content displayed at the top of the drop-down list *@ | ||
| <HeaderContent> | ||
| <FluentText Size="TextSize.Size200" Color="Color.Primary" Align="TextAlign.Center"> | ||
| Suggested contacts | ||
| </FluentText> | ||
| <FluentProgressBar Thickness="ProgressThickness.Large" Visible="@context.InProgress" /> | ||
| </HeaderContent> | ||
|
|
||
| @* Content displayed at the bottom of the drop-down list *@ | ||
| <FooterContent> | ||
| @if (!context.Items.Any()) | ||
| { | ||
| <FluentText Size="TextSize.Size200" Align="TextAlign.Center" Color="Color.Error" Style="width: 100%;"> | ||
| No results found | ||
| </FluentText> | ||
| } | ||
| </FooterContent> | ||
|
|
||
| </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" /> | ||
| <FluentSwitch @bind-Value="@Multiple" Label="Multiple selection" /> | ||
| <FluentSwitch @bind-Value="@SetMaximumSelectedOptions" Label="Set MaximumSelectedOptions to 4" /> | ||
| <FluentButton OnClick="@SetSelectedCountriesAsync"> | ||
| Set SelectedCountries to [be, fr] | ||
| </FluentButton> | ||
| </FluentStack> | ||
|
|
||
|
|
||
| <FluentAutocomplete TOption="Country" | ||
| TValue="string" | ||
| Width="100%" | ||
| MaximumOptionsSearch="int.MaxValue" | ||
| Label="Select countries from Items" | ||
| Items="@Countries" | ||
| OptionText="@(item => item.Name)" | ||
| @bind-SelectedItems="@SelectedCountries" /> | ||
|
|
||
| </div> | ||
|
|
||
| @code | ||
| { | ||
| bool ShowProgressIndicator { get; set; } | ||
| bool MaxAutoHeight { get; set; } | ||
| bool MaxSelectedWidth { get; set; } | ||
| bool ShowDismiss { get; set; } = true; | ||
| bool Multiple { get; set; } = true; | ||
| bool SetMaximumSelectedOptions { get; set; } | ||
| 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); | ||
| } | ||
|
|
||
| async Task SetSelectedCountriesAsync() | ||
| { | ||
| SelectedCountries = Countries.Where(i => i.Code == "be" || i.Code == "fr"); | ||
| await Task.CompletedTask; | ||
| } | ||
| } | ||
41 changes: 41 additions & 0 deletions
41
...emo.Client/Documentation/Components/List/Autocomplete/Examples/AutocompleteComparer.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| <div>Selected: <b>@string.Join("; ", Selected.Select(x => x.Name))</b></div> | ||
|
|
||
| <FluentAutocomplete TOption="MyUser" | ||
| TValue="int" | ||
| Width="100%" | ||
| Label="Name" | ||
| Placeholder="Select a user" | ||
| OptionText="(option) => option.Name" | ||
| OptionValue="(option) => option.UserId" | ||
| OptionSelectedComparer="MyComparer.Instance" | ||
| OnOptionsSearch="@OnSearchAsync" | ||
| @bind-SelectedItems="@Selected" /> | ||
|
|
||
| @code | ||
| { | ||
| IEnumerable<MyUser> Selected { get; set; } = []; | ||
|
|
||
| /// Search method called when the user types in the input or opens the options list. | ||
| /// A new list of MyUser is assigned with new object instances. | ||
| /// The component will use the OptionSelectedComparer to check if any of the new items are already selected. | ||
| Task OnSearchAsync(OptionsSearchEventArgs<MyUser> e) | ||
| { | ||
| e.Items = [ | ||
| new MyUser(1, "Marvin Klein"), | ||
| new MyUser(2, "Denis Voituron"), | ||
| ]; | ||
|
|
||
| return Task.CompletedTask; | ||
| } | ||
|
|
||
| record MyUser(int UserId, string Name); | ||
|
|
||
| class MyComparer : IEqualityComparer<MyUser> | ||
| { | ||
| public static readonly MyComparer Instance = new(); | ||
|
|
||
| public bool Equals(MyUser? x, MyUser? y) => x?.UserId == y?.UserId; | ||
|
|
||
| public int GetHashCode(MyUser obj) => obj.UserId.GetHashCode(); | ||
| } | ||
| } |
82 changes: 82 additions & 0 deletions
82
...o.Client/Documentation/Components/List/Autocomplete/Examples/AutocompleteCustomized.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| @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"> | ||
|
|
||
| @* Template used with each Option items *@ | ||
| <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> | ||
|
|
||
|
|
||
| @* Content display at the top of the Popup area *@ | ||
| <HeaderContent> | ||
| <FluentText Size="TextSize.Size200" Color="Color.Primary" Align="TextAlign.Center"> | ||
| Suggested contacts | ||
| </FluentText> | ||
| <FluentProgressBar Thickness="ProgressThickness.Large" Visible="@context.InProgress" /> | ||
| </HeaderContent> | ||
|
|
||
| @* Content display at the bottom of the Popup area *@ | ||
| <FooterContent> | ||
| @if (!context.InProgress && !context.Items.Any()) | ||
| { | ||
| <FluentText Size="TextSize.Size200" | ||
| Align="TextAlign.Center" | ||
| Color="Color.Error" | ||
| Style="width: 100%;"> | ||
| No results found | ||
| </FluentText> | ||
| } | ||
| </FooterContent> | ||
|
|
||
| </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); | ||
| } | ||
| } |
25 changes: 25 additions & 0 deletions
25
...Demo.Client/Documentation/Components/List/Autocomplete/Examples/AutocompleteDefault.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } | ||
| } |
31 changes: 31 additions & 0 deletions
31
...lient/Documentation/Components/List/Autocomplete/Examples/AutocompleteMultipleFalse.razor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| @using static FluentUI.Demo.SampleData.Olympics2024 | ||
|
|
||
| <div>Selected: <b>@SelectedCountry?.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; } = []; | ||
|
|
||
| Country? SelectedCountry | ||
| { | ||
| get => SelectedCountries.FirstOrDefault() ?? default; | ||
| set => SelectedCountries = value is not null ? [value] : []; | ||
| } | ||
|
|
||
| Task OnSearchAsync(OptionsSearchEventArgs<Country> e) | ||
| { | ||
| e.Items = Countries.Where(i => i.Name.StartsWith(e.Text, StringComparison.OrdinalIgnoreCase)) | ||
| .OrderBy(i => i.Name); | ||
|
|
||
| return Task.CompletedTask; | ||
| } | ||
| } |
67 changes: 67 additions & 0 deletions
67
...UI.Demo.Client/Documentation/Components/List/Autocomplete/FluentAutocomplete.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| --- | ||
| 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. | ||
|
|
||
| This is particularly useful when the list of options is large, as the user can narrow down the list op options without needing to scroll through all available items. | ||
|
|
||
| By default, the `FluentAutocomplete` component compares search results by instance with its internal selected items. | ||
| You can control this behavior by providing the `OptionSelectedComparer` parameter. | ||
|
|
||
| > **Note:** Accessibility requirements are not yet implemented for this component. | ||
|
|
||
| ## 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 }} | ||
|
|
||
| ## Different object instances from search result | ||
|
|
||
| When the `OnOptionsSearch` method returns **new object instances** on each call (e.g. from an API or database query), | ||
| the component cannot match them to already-selected items by **reference**. | ||
|
|
||
| Use the `OptionSelectedComparer` parameter to provide a custom `IEqualityComparer<TOption>` that compares items by a unique key (such as an ID) | ||
| instead of by reference. Without this, previously selected items may not appear as checked in the refreshed list. | ||
|
|
||
| {{ AutocompleteComparer }} | ||
|
|
||
| ## API FluentAutocomplete | ||
|
|
||
| {{ API Type=FluentAutocomplete<string,string> }} | ||
|
|
||
| ## Migrating to v5 | ||
|
|
||
| {{ INCLUDE File=MigrationFluentAutocomplete }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.