From 7c60aefe3162c8b631122cc9c0e4891b4b65c474 Mon Sep 17 00:00:00 2001 From: markosteger Date: Thu, 16 Feb 2023 14:25:48 +0100 Subject: [PATCH] SimpleSelect - code cleanup (removed unnecessary blank space, removed unused private methods) --- .../Components/SimpleSelect.razor | 4 +--- .../Components/SimpleSelect.razor.cs | 21 ++----------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/Connected.Components/Components/SimpleSelect.razor b/src/Connected.Components/Components/SimpleSelect.razor index ec9c163..8fb0f45 100644 --- a/src/Connected.Components/Components/SimpleSelect.razor +++ b/src/Connected.Components/Components/SimpleSelect.razor @@ -7,7 +7,6 @@ @if (Items is not null) {
- @if (IsLabel) @@ -42,8 +41,7 @@ + @bind-value="@SearchText" /> } @foreach (ValueType item in Items) { diff --git a/src/Connected.Components/Components/SimpleSelect.razor.cs b/src/Connected.Components/Components/SimpleSelect.razor.cs index 0490ae6..456a06b 100644 --- a/src/Connected.Components/Components/SimpleSelect.razor.cs +++ b/src/Connected.Components/Components/SimpleSelect.razor.cs @@ -29,30 +29,13 @@ public partial class SimpleSelect : 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 : InputBase { OriginalItems = Items; - if (_searchText.Length>0) await FilterItems(); + if (_searchText.Length>0) FilterItems(); await base.OnParametersSetAsync(); }