Skip to content

Commit c24581c

Browse files
committed
refactor: 增加滚动逻辑
1 parent 81e99b9 commit c24581c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/BootstrapBlazor/Components/TreeView/TreeView.razor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ protected override async Task OnParametersSetAsync()
361361
{
362362
await CheckExpand(Items);
363363
_rows = null;
364+
_keyboardArrowUpDownTrigger = true;
364365
}
365366

366367
if (ShowCheckbox && (AutoCheckParent || AutoCheckChildren))
@@ -397,7 +398,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
397398
if (_keyboardArrowUpDownTrigger)
398399
{
399400
_keyboardArrowUpDownTrigger = false;
400-
await InvokeVoidAsync("scroll", Id, ScrollIntoViewOptions);
401+
await InvokeVoidAsync("scroll", Id, ScrollIntoViewOptions, _activeItem != null && IsVirtualize);
401402
}
402403
}
403404

0 commit comments

Comments
 (0)