@inject IJSRuntime JSRuntime @code { [Parameter] public Func GetControl { get; set; } protected override async Task OnAfterRenderAsync(bool firstRender) { if (GetControl is null) throw new ArgumentNullException(nameof(GetControl)); if (firstRender) await JSRuntime.InvokeVoidAsync("App.scrollIntoView", GetControl(), true); } }