Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 18 additions & 8 deletions src/Core/Components/List/FluentAutocomplete.razor
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
aria-label="@GetAutocompleteAriaLabel()"
Value="@ValueText"
@onclick="@OnDropDownExpandedAsync"
@oninput="@InputHandlerAsync"
@oninput="@InputHandlerAsync"
autofocus="@Autofocus"
Style="@ComponentWidth">
@* Selected Items *@
Expand Down Expand Up @@ -68,7 +68,7 @@
}

}
@if (!Disabled)
@if (!Disabled && !ReadOnly)
{
if (this.SelectedOptions?.Any() == true || !string.IsNullOrEmpty(ValueText))
{
Expand Down Expand Up @@ -205,12 +205,22 @@
{
var text = @GetOptionText(item);

<FluentBadge Appearance="@AspNetCore.Components.Appearance.Neutral"
OnDismissClick="@(e => RemoveSelectedItemAsync(item))"
DismissTitle="@(string.Format(AccessibilityRemoveItem, text))"
aria-label="@GetOptionText(item)">
@text
</FluentBadge>
if (ReadOnly || Disabled)
{
<FluentBadge Appearance="@AspNetCore.Components.Appearance.Neutral"
aria-label="@GetOptionText(item)">
@text
</FluentBadge>
}
else
{
<FluentBadge Appearance="@AspNetCore.Components.Appearance.Neutral"
OnDismissClick="@(e => RemoveSelectedItemAsync(item))"
DismissTitle="@(string.Format(AccessibilityRemoveItem, text))"
aria-label="@GetOptionText(item)">
@text
</FluentBadge>
}
}
else
{
Expand Down
5 changes: 5 additions & 0 deletions src/Core/Components/List/FluentAutocomplete.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ private string ComponentWidth
/// <summary />
protected override async Task InputHandlerAsync(ChangeEventArgs e)
{
if (ReadOnly || Disabled)
{
return;
}

ValueText = e.Value?.ToString() ?? string.Empty;
await RaiseValueTextChangedAsync(ValueText);

Expand Down