File tree Expand file tree Collapse file tree 4 files changed +43
-4
lines changed Expand file tree Collapse file tree 4 files changed +43
-4
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >9.1.3 </Version >
4+ <Version >9.1.4 </Version >
55 </PropertyGroup >
66
77 <ItemGroup >
Original file line number Diff line number Diff line change @@ -323,6 +323,21 @@ protected override void OnParametersSet()
323323 SelectedItem = null ;
324324 }
325325
326+ /// <summary>
327+ /// <inheritdoc/>
328+ /// </summary>
329+ /// <returns></returns>
330+ protected override async Task OnAfterRenderAsync ( bool firstRender )
331+ {
332+ await base . OnAfterRenderAsync ( firstRender ) ;
333+
334+ if ( firstRender )
335+ {
336+ await RefreshVirtualizeElement ( ) ;
337+ StateHasChanged ( ) ;
338+ }
339+ }
340+
326341 /// <summary>
327342 /// 获得/设置 数据总条目
328343 /// </summary>
@@ -356,7 +371,12 @@ private async Task SearchTextChanged(string val)
356371 {
357372 _itemsCache = null ;
358373 SearchText = val ;
359- if ( OnQueryAsync != null )
374+ await RefreshVirtualizeElement ( ) ;
375+ }
376+
377+ private async Task RefreshVirtualizeElement ( )
378+ {
379+ if ( IsVirtualize && OnQueryAsync != null )
360380 {
361381 // 通过 ItemProvider 提供数据
362382 await VirtualizeElement . RefreshDataAsync ( ) ;
Original file line number Diff line number Diff line change @@ -346,6 +346,21 @@ protected override void OnParametersSet()
346346 SelectedItem = null ;
347347 }
348348
349+ /// <summary>
350+ /// <inheritdoc/>
351+ /// </summary>
352+ /// <returns></returns>
353+ protected override async Task OnAfterRenderAsync ( bool firstRender )
354+ {
355+ await base . OnAfterRenderAsync ( firstRender ) ;
356+
357+ if ( firstRender )
358+ {
359+ await RefreshVirtualizeElement ( ) ;
360+ StateHasChanged ( ) ;
361+ }
362+ }
363+
349364 /// <summary>
350365 /// 获得/设置 数据总条目
351366 /// </summary>
@@ -379,8 +394,12 @@ private async Task SearchTextChanged(string val)
379394 {
380395 SearchText = val ;
381396 _itemsCache = null ;
397+ await RefreshVirtualizeElement ( ) ;
398+ }
382399
383- if ( OnQueryAsync != null )
400+ private async Task RefreshVirtualizeElement ( )
401+ {
402+ if ( IsVirtualize && OnQueryAsync != null )
384403 {
385404 // 通过 ItemProvider 提供数据
386405 await VirtualizeElement . RefreshDataAsync ( ) ;
Original file line number Diff line number Diff line change @@ -773,7 +773,7 @@ public async Task IsVirtualize_BindValue()
773773 } ) ;
774774
775775 var input = cut . Find ( ".form-select" ) ;
776- Assert . Null ( input . GetAttribute ( "value" ) ) ;
776+ Assert . Equal ( "3" , input . GetAttribute ( "value" ) ) ;
777777
778778 var select = cut . Instance ;
779779 Assert . Equal ( "3" , select . Value ? . Value ) ;
You can’t perform that action at this time.
0 commit comments