SimpleSelect - code cleanup (removed unnecessary blank space, removed unused private methods)

features/rewrite/checkbox
markosteger 2 years ago
parent 587d6c5109
commit 03b00565e5

@ -7,7 +7,6 @@
@if (Items is not null)
{
<div class="@InputFieldClassList">
<select type="textarea" style="height:0px;" @attributes=@InputAttributes>
</select>
@if (IsLabel)
@ -42,8 +41,7 @@
<input type="text"
placeholder="Enter search string..."
class="dropdown-item"
@bind-value="@SearchText"
/>
@bind-value="@SearchText" />
}
@foreach (ValueType item in Items)
{

@ -29,30 +29,13 @@ public partial class SimpleSelect<ValueType> : InputBase
}
}
private string DropDownClass { get; set; } = "drop-down";
bool DropDownClicked = false;
public void DropDownClassToggle()
{
DropDownClicked = !DropDownClicked;
if (DropDownClicked)
{
DropDownClass = "";
} else
{
DropDownClass = "drop-down";
}
StateHasChanged();
}
private async Task SetSelectedItem(ValueType item)
{
//DropDownClassToggle();
await ValueChanged.InvokeAsync(item);
}
private async Task FilterItems()
private void FilterItems()
{
if (string.IsNullOrEmpty(_searchText))
{
@ -78,7 +61,7 @@ public partial class SimpleSelect<ValueType> : InputBase
{
OriginalItems = Items;
if (_searchText.Length>0) await FilterItems();
if (_searchText.Length>0) FilterItems();
await base.OnParametersSetAsync();
}

Loading…
Cancel
Save