🎨 Simplify scroll position calculation formatting in GamemasterExplorer component
This commit is contained in:
@@ -770,7 +770,8 @@ function scrollToResult() {
|
|||||||
const elementHeight = lineElement.offsetHeight;
|
const elementHeight = lineElement.offsetHeight;
|
||||||
|
|
||||||
// Calculate scroll position to center element in container
|
// 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' });
|
container.scrollTo({ top: scrollTo, behavior: 'smooth' });
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user