🎨 Simplify scroll position calculation formatting in GamemasterExplorer component
This commit is contained in:
@@ -768,9 +768,10 @@ function scrollToResult() {
|
||||
const elementOffsetTop = lineElement.offsetTop;
|
||||
const containerHeight = container.clientHeight;
|
||||
const elementHeight = lineElement.offsetHeight;
|
||||
|
||||
|
||||
// Calculate scroll position to center element in container
|
||||
const scrollTo = elementOffsetTop - (containerHeight / 2) + (elementHeight / 2);
|
||||
const scrollTo =
|
||||
elementOffsetTop - containerHeight / 2 + elementHeight / 2;
|
||||
container.scrollTo({ top: scrollTo, behavior: 'smooth' });
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user