diff --git a/src/Core/Components/List/FluentSelect.razor b/src/Core/Components/List/FluentSelect.razor index 3ec4f2187e..de964582b6 100644 --- a/src/Core/Components/List/FluentSelect.razor +++ b/src/Core/Components/List/FluentSelect.razor @@ -3,7 +3,7 @@ @typeparam TOption @InlineStyleValue - + : ListComponentBase where TOption : notnull { + /// + /// Gets the `Required` aria label. + /// + public static string RequiredAriaLabel = "Required"; + /// protected virtual MarkupString InlineStyleValue => new InlineStyleBuilder() .AddStyle($"#{Id}::part(listbox)", "max-height", Height, !string.IsNullOrWhiteSpace(Height)) @@ -39,4 +44,11 @@ public partial class FluentSelect : ListComponentBase where TO /// [Parameter] public Appearance? Appearance { get; set; } + + private string? GetAriaLabelWithRequired() + { + var label = AriaLabel ?? Label ?? Title ?? string.Empty; + + return label + (Required ? $", {RequiredAriaLabel}" : string.Empty); + } }