Skip to content

Commit

Permalink
Fix cherry-pick
Browse files Browse the repository at this point in the history
  • Loading branch information
vnbaaij committed Jun 30, 2024
1 parent 4c0d91c commit 046218a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/Core/Components/List/FluentAutocomplete.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@
<div class="@ClassValue fluent-autocomplete-multiselect"
style="@StyleValue"
auto-height="@(!string.IsNullOrEmpty(MaxAutoHeight))">
<FluentInputLabel ForId="@Id" Label="@Label" AriaLabel="@GetAriaLabel()" ChildContent="@LabelTemplate" Required="@Required" />
<FluentKeyCode Anchor="@Id" OnKeyDown="@KeyDownHandlerAsync" Only="@CatchOnly" PreventDefaultOnly="@PreventOnly" />

<FluentTextField role="combobox"
@ref="@Element"
Id="@Id"
Name="@Name"
Embedded="true"
Required="@Required"
AutoComplete="@AutoComplete"
Appearance="@Appearance"
Disabled="@Disabled"
ReadOnly="@ReadOnly"
Label="@Label"
LabelTemplate="@LabelTemplate"
Placeholder="@(SelectedOptions?.Any() is false ? Placeholder : string.Empty)"
aria-expanded="@(IsMultiSelectOpened ? "true" : "false")"
aria-controls="@(IsMultiSelectOpened ? IdPopup : string.Empty)"
aria-label="@GetAutocompleteAriaLabel()"
Value="@ValueText"
Required="@Required"
@onclick="@OnDropDownExpandedAsync"
@oninput="@InputHandlerAsync"
autofocus="@Autofocus"
Expand Down Expand Up @@ -68,7 +67,7 @@
}

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

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

0 comments on commit 046218a

Please sign in to comment.