Skip to content

Commit 1d89c83

Browse files
authored
Select Fix Selected Style on Scroll When Virtualize True (#149)
1 parent 76ff7c8 commit 1d89c83

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CodeBeam.MudBlazor.Extensions/Components/ListExtended/MudListExtended.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@using MudBlazor
55
@using MudExtensions.Enums
66

7-
<div @attributes="UserAttributes" id="@_elementId" class="@Classname" style="@Stylename" tabindex="-1" @onkeydown="HandleKeyDown" @onfocusout="HandleOnFocusOut">
7+
<div @attributes="UserAttributes" id="@_elementId" class="@Classname" style="@Stylename" tabindex="-1" @onkeydown="HandleKeyDown" @onfocusout="HandleOnFocusOut" @onscroll="HandleOnScroll">
88
<CascadingValue Value="@this" IsFixed="true">
99
@if (MultiSelection && SelectAll && SelectAllPosition == SelectAllPosition.BeforeSearchBox && ParentList == null)
1010
{

CodeBeam.MudBlazor.Extensions/Components/ListExtended/MudListExtended.razor.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,14 @@ protected async Task HandleOnFocusOut()
852852
await OnFocusOut.InvokeAsync();
853853
}
854854

855+
protected void HandleOnScroll()
856+
{
857+
if (Virtualize == true)
858+
{
859+
UpdateSelectedStyles();
860+
}
861+
}
862+
855863
#endregion
856864

857865

0 commit comments

Comments
 (0)