diff --git a/code/websites/pokedex.online/src/views/GamemasterExplorer.vue b/code/websites/pokedex.online/src/views/GamemasterExplorer.vue index cd25954..59bce73 100644 --- a/code/websites/pokedex.online/src/views/GamemasterExplorer.vue +++ b/code/websites/pokedex.online/src/views/GamemasterExplorer.vue @@ -761,8 +761,16 @@ function scrollToResult() { const lineElement = document.querySelector(`[data-line="${lineNumber}"]`); if (lineElement) { - // Element is rendered, scroll it into view - lineElement.scrollIntoView({ behavior: 'smooth', block: 'center' }); + // Scroll only within the container, not the whole page + const container = lineElement.closest('.scroller, .lines-container'); + if (container) { + const containerRect = container.getBoundingClientRect(); + const elementRect = lineElement.getBoundingClientRect(); + + // Calculate scroll position to center element in container + const scrollOffset = elementRect.top - containerRect.top - (containerRect.height / 2) + (elementRect.height / 2); + container.scrollBy({ top: scrollOffset, behavior: 'smooth' }); + } return true; } else if (attempt < 3) { // Virtual scroller may not have rendered yet, try again