I’d like to know the best practices for scrolling tables in a Blazor Server app. At the moment, I am invoking a simple Javascript (see below) in the OnAfterRenderAsync method of the applicable component. That works, but the scrolling is a bit delayed. Two questions:
(1) Does the scrolling have to be done by Javascript? I haven’t found an alternative.
(2) If I need JS, is this the best way to do it (i.e. in OnAfterRenderAsync and with the JS below)? The sync OnAfterRender isn’t any better. Thanks. Steve
function Nav_ScrollIntoView(navId)
{
var elem = document.getElementById(navId);
if (elem === null) return;
elem.scrollIntoView({ behavior: 'instant' });
return;
}