Fix gitea issues #54

Merged
Egamorf merged 10 commits from fix/correct-gitea-issues into main 2025-05-18 16:27:57 +02:00
4 changed files with 25 additions and 7 deletions
Showing only changes of commit c7a77d1d9e - Show all commits

View File

@@ -49,17 +49,15 @@ public partial class AdvancedGameFilter
throw new ArgumentNullException(ResourcesKey.ErrorStorageSpaceLabel);
}
private async Task HandleExpandFilterAsync(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
private void HandleExpandFilterAsync(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
{
ExpandedFilter = true;
await ExpandedFilterChanged.InvokeAsync(ExpandedFilter);
BackdropFilter?.Show();
}
private async Task HandleBackdropFilterClickedAsync()
private void HandleBackdropFilterClickedAsync()
{
ExpandedFilter = false;
await ExpandedFilterChanged.InvokeAsync(ExpandedFilter);
}
private void HandleLocationChanged(LocationChangingContext locationContext)

View File

@@ -26,7 +26,7 @@
height: 100%;
width: 100%;
padding: 0;
min-width: 0;
min-width: 0;
}
.clear-icon {
@@ -34,7 +34,7 @@
min-width: 18px;
height: 18px;
width: 18px;
z-index: var(--index-overlay);
z-index: 800;
}
.clear-icon:hover {

View File

@@ -10,7 +10,7 @@
<div class="@SelectHelper.GetClassFromTheme(Theme)">
<SearchInput @ref=SearchInput Icon="SearchInputIcon.Dropdown" Placeholder="@Placeholder"
TextChanged="HandleClearClicked" ClearClicked="HandleClearClicked" IsDisable=false
TextChanged="HandleTextChanged" ClearClicked="HandleClearClicked" IsDisable=false
FocusIn="HandleFocusIn" SearchClicked="HandleFocusIn" />
</div>

View File

@@ -1,3 +1,4 @@
using GameIdeas.BlazorApp.Pages.Games;
using GameIdeas.BlazorApp.Shared.Components.Search;
using GameIdeas.BlazorApp.Shared.Components.Select;
using GameIdeas.BlazorApp.Shared.Components.Select.Models;
@@ -61,4 +62,23 @@ public partial class SelectSearch<TItem>
{
Select?.Open();
}
private void HandleTextChanged(string args)
{
if (!string.IsNullOrEmpty(args))
{
var keywords = args
.Split([' '], StringSplitOptions.RemoveEmptyEntries)
.Select(k => k.Trim())
.ToArray() ?? [];
SelectParams.Items = [.. Items
.Where(game => keywords.All(
kw => SelectParams.GetItemLabel(game).Contains(kw, StringComparison.OrdinalIgnoreCase)
))
.OrderBy(game => keywords.Min(kw =>
SelectParams.GetItemLabel(game).IndexOf(kw, StringComparison.OrdinalIgnoreCase)
))
.ThenBy(game => SelectParams.GetItemLabel(game).Length)];
}
}
}