File tree Expand file tree Collapse file tree 2 files changed +23
-8
lines changed
Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 2626 aria-label =" @GetAutocompleteAriaLabel()"
2727 Value =" @ValueText"
2828 @onclick =" @OnDropDownExpandedAsync"
29- @oninput =" @InputHandlerAsync"
29+ @oninput =" @InputHandlerAsync"
3030 autofocus =" @Autofocus"
3131 Style =" @ComponentWidth" >
3232 @* Selected Items *@
6868 }
6969
7070 }
71- @if (! Disabled )
71+ @if (! Disabled && ! ReadOnly )
7272 {
7373 if (this .SelectedOptions ? .Any () == true || ! string .IsNullOrEmpty (ValueText ))
7474 {
205205 {
206206 var text = @GetOptionText (item );
207207
208- < FluentBadge Appearance = " @AspNetCore.Components.Appearance.Neutral"
209- OnDismissClick = " @(e => RemoveSelectedItemAsync(item))"
210- DismissTitle = " @(string.Format(AccessibilityRemoveItem, text))"
211- aria - label = " @GetOptionText(item)" >
212- @text
213- < / FluentBadge >
208+ if (ReadOnly || Disabled )
209+ {
210+ < FluentBadge Appearance = " @AspNetCore.Components.Appearance.Neutral"
211+ aria - label = " @GetOptionText(item)" >
212+ @text
213+ < / FluentBadge >
214+ }
215+ else
216+ {
217+ < FluentBadge Appearance = " @AspNetCore.Components.Appearance.Neutral"
218+ OnDismissClick = " @(e => RemoveSelectedItemAsync(item))"
219+ DismissTitle = " @(string.Format(AccessibilityRemoveItem, text))"
220+ aria - label = " @GetOptionText(item)" >
221+ @text
222+ < / FluentBadge >
223+ }
214224 }
215225 else
216226 {
Original file line number Diff line number Diff line change @@ -265,6 +265,11 @@ private string ComponentWidth
265265 /// <summary />
266266 protected override async Task InputHandlerAsync ( ChangeEventArgs e )
267267 {
268+ if ( ReadOnly || Disabled )
269+ {
270+ return ;
271+ }
272+
268273 ValueText = e . Value ? . ToString ( ) ?? string . Empty ;
269274 await RaiseValueTextChangedAsync ( ValueText ) ;
270275
You can’t perform that action at this time.
0 commit comments