Fix CategoryTreeSelect: fix malformed null-coalescing expressions that were showing as literal text

This commit is contained in:
Saidamin Kattan
2026-08-08 18:18:01 +03:00
parent 86ad77116d
commit 1d9ad26b98
+3 -5
View File
@@ -5,8 +5,7 @@
<button type="button"
class="select select-bordered w-full flex items-center justify-between h-auto py-3 bg-base-100 hover:bg-base-200 transition-colors"
@onclick="ToggleDropdown">
<span class="truncate">@(SelectedCategory?.Translations?.FirstOrDefault()?.Info?.Name ?? string.Empty) ??
Placeholder)</span>
<span class="truncate">@(SelectedCategory?.Translations?.FirstOrDefault()?.Info?.Name ?? Placeholder)</span>
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 opacity-50 shrink-0" viewBox="0 0 20 20"
fill="currentColor">
<path fill-rule="evenodd"
@@ -44,7 +43,7 @@
<button type="button"
class="btn btn-ghost btn-xs normal-case @(_activeLevel == index + 1 ? "text-primary font-bold bg-primary/10" : "text-base-content/60")"
@onclick="() => SetLevel(index + 1)">
@step.Translations?.FirstOrDefault()?.Info?.Name ?? string.Empty)
@step.Translations?.FirstOrDefault()?.Info?.Name
</button>
</div>
}
@@ -88,8 +87,7 @@
</div>
<div class="flex flex-col">
<span
class="font-medium @(cat.Id == Value ? "text-primary font-bold" : "text-base-content")">@cat.Translations?.FirstOrDefault()?.Info?.Name
?? string.Empty)</span>
class="font-medium @(cat.Id == Value ? "text-primary font-bold" : "text-base-content")">@(cat.Translations?.FirstOrDefault()?.Info?.Name ?? "")</span>
@if (cat.Id == Value)
{
<span class="text-[10px] text-primary uppercase font-bold tracking-wider">Selected</span>