@likable-hair/svelte 3.3.14 → 3.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
ToolTip
|
|
14
14
|
} from "../../..";
|
|
15
15
|
import { DateTime } from "luxon";
|
|
16
|
-
import { createEventDispatcher, onMount } from "svelte";
|
|
16
|
+
import { createEventDispatcher, onMount, tick } from "svelte";
|
|
17
17
|
import { quintOut } from "svelte/easing";
|
|
18
18
|
import { crossfade, fade } from "svelte/transition";
|
|
19
19
|
import Filters from "../search/Filters.svelte";
|
|
@@ -595,7 +595,7 @@ function handleRemoveFilter(filter) {
|
|
|
595
595
|
dispatch("removeFilter", { filter });
|
|
596
596
|
handleSearchChange(searchText);
|
|
597
597
|
}
|
|
598
|
-
function handleLoadForward() {
|
|
598
|
+
async function handleLoadForward() {
|
|
599
599
|
if (renderedRows.length >= renderedRowsNumber) {
|
|
600
600
|
userScrolling = false;
|
|
601
601
|
const anchorIndex = renderedRowsNumber - 1;
|
|
@@ -613,19 +613,18 @@ function handleLoadForward() {
|
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
currentSectionNumber = currentSectionNumber + 1;
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}, 10);
|
|
616
|
+
await tick();
|
|
617
|
+
const anchorElementAfter = findAnchorElement(anchorUniqueKey);
|
|
618
|
+
const anchorOffsetAfter = anchorElementAfter?.getBoundingClientRect().top || 0;
|
|
619
|
+
const offsetDiff = anchorOffsetAfter - anchorOffsetBefore;
|
|
620
|
+
tableContainer.scrollTop += offsetDiff;
|
|
621
|
+
userScrolling = true;
|
|
623
622
|
}
|
|
624
623
|
if (totalCachedSections - sectionThreshold <= currentSectionNumber && !loading && totalRows > rows.length) {
|
|
625
624
|
dispatch("fetchData", {});
|
|
626
625
|
}
|
|
627
626
|
}
|
|
628
|
-
function handleLoadBackward() {
|
|
627
|
+
async function handleLoadBackward() {
|
|
629
628
|
userScrolling = false;
|
|
630
629
|
const anchorIndex = 0;
|
|
631
630
|
const anchorUniqueKey = renderedRows[anchorIndex].item[uniqueKey];
|
|
@@ -642,13 +641,12 @@ function handleLoadBackward() {
|
|
|
642
641
|
}
|
|
643
642
|
}
|
|
644
643
|
currentSectionNumber = currentSectionNumber - 1;
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
}, 10);
|
|
644
|
+
await tick();
|
|
645
|
+
const anchorElementAfter = findAnchorElement(anchorUniqueKey);
|
|
646
|
+
const anchorOffsetAfter = anchorElementAfter?.getBoundingClientRect().top || 0;
|
|
647
|
+
const offsetDiff = anchorOffsetAfter - anchorOffsetBefore;
|
|
648
|
+
tableContainer.scrollTop += offsetDiff;
|
|
649
|
+
userScrolling = true;
|
|
652
650
|
}
|
|
653
651
|
function findAnchorElement(key) {
|
|
654
652
|
for (let i = 0; i < tableBody.children.length; i++) {
|