fix: scroll to top of panel on pagination click

Instead of the body. Added a slight offset to counteract the sticky navbar.
This commit is contained in:
Roardom
2025-02-26 20:05:17 +00:00
parent 51937c897e
commit bb86f2fca7
@@ -1,12 +1,12 @@
@php
if (! isset($scrollTo)) {
$scrollTo = 'body';
$scrollTo = '.panelV2';
}
$scrollIntoViewJsSnippet =
$scrollTo !== false
? <<<JS
(\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView()
window.scroll({ top: ((\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).offsetTop - 80)})
JS
: '';
@endphp