Bug fix for scroll to end.

This commit is contained in:
Scott Idem
2025-09-19 16:50:14 -04:00
parent 5b7aa320e2
commit 79c0c90eae
2 changed files with 35 additions and 23 deletions

View File

@@ -307,6 +307,35 @@ function scroll_container() {
Scroll to Top
</button>
<!-- Scroll to the right button -->
<button
type="button"
class="
ae_btn_success_outlined
btn btn-sm btn-secondary
preset-tonal-surface
transition-all duration-500
"
class:ae_btn_warning_filled={xLeft + xWidth < xScroll - 750}
onclick={() => {
document.getElementById('ae_main_content')?.scrollTo({
left: 0,
behavior: 'smooth'
});
window.parent.postMessage({'scroll_to': scroll_x}, "*");
}}
title="Scroll to right"
>
<span class="fas fa-arrow-right"></span>
<!-- Scroll to Right
xLeft={xLeft} xScroll={xScroll} xWidth={xWidth} scroll_x={scroll_x} scrollLeft={scroll_container().scrollLeft}
total={xLeft + xWidth} -->
</button>
<!-- Scroll to bottom button -->
<button
type="button"
@@ -334,7 +363,7 @@ function scroll_container() {
console.log('Not Safari, using smooth scroll to bottom');
document.getElementById('ae_main_content')?.scrollTo({
top: scroll_y,
top: yScroll,
behavior: 'smooth'
});
@@ -344,6 +373,7 @@ function scroll_container() {
>
<span class="fas fa-arrow-down"></span>
Scroll to Bottom
<!-- yTop={yTop} yScroll={yScroll} yHeight={yHeight} scroll_y={scroll_y} scrollTop={scroll_container().scrollTop} total={scroll_container().scrollTop + yHeight} -->
</button>
</div>