diff --git a/code/websites/pokedex.online/src/views/GamemasterExplorer.vue b/code/websites/pokedex.online/src/views/GamemasterExplorer.vue index 07fcac8..3086ced 100644 --- a/code/websites/pokedex.online/src/views/GamemasterExplorer.vue +++ b/code/websites/pokedex.online/src/views/GamemasterExplorer.vue @@ -765,10 +765,11 @@ function scrollToResult() { const scroller = virtualScroller.value; const itemHeight = lineHeight.value; const containerHeight = scroller.$el.clientHeight; - + // Calculate scroll position to center the item - const targetScrollTop = (lineIndex * itemHeight) - (containerHeight / 2) + (itemHeight / 2); - + const targetScrollTop = + lineIndex * itemHeight - containerHeight / 2 + itemHeight / 2; + // Use the scroller's internal scrollTop scroller.$el.scrollTop = Math.max(0, targetScrollTop); });