Skip to content
Closed
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
12 changes: 12 additions & 0 deletions src/MatBlazor/Components/MatAutocomplete/BaseMatAutocomplete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ public string StringValue
}
}

/// <summary>
/// This value is only returned for use in ValueExpression (required to make MatAutocomplete work inside EditForms).
/// </summary>
protected string DummyValue
{
get
{
return " ";
}
set { }
}

/// <summary>
/// The value to be used to pre-select an item from the list
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


<div class="@WrapperClassMapper.Class">
<MatTextField Icon="@Icon" OnFocus="@OpenPopup" HideClearButton="true" FullWidth="@FullWidth" OnFocusOut="@ClosePopup" Label="@Label" Value=@StringValue OnInput=@OnValueChanged OnKeyDown="@OnKeyDown" Outlined="@Outlined" Attributes="@Attributes" Id="@Id"></MatTextField>
@if (IsShowingClearButton)
{
<div class="mat-autocomplete-clearbutton">
Expand All @@ -32,4 +31,5 @@
</MatList>
</div>
}
<MatTextField Icon="@Icon" OnFocus="@OpenPopup" HideClearButton="true" FullWidth="@FullWidth" OnFocusOut="@ClosePopup" Label="@Label" Value="@StringValue" OnInput=@OnValueChanged OnKeyDown="@OnKeyDown" Outlined="@Outlined" Attributes="@Attributes" Id="@Id" ValueExpression="@(() => DummyValue)"></MatTextField>
</div>