@ibragim-dev-org/ui-forge-library 1.4.67 → 1.4.68
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.
|
@@ -858,6 +858,8 @@ class StableScrollDirective {
|
|
|
858
858
|
mutationObserver;
|
|
859
859
|
restoreFrameId = null;
|
|
860
860
|
restoreMicrotaskPending = false;
|
|
861
|
+
// Restoration only runs after captureBeforeChange(); otherwise the element scrolls natively.
|
|
862
|
+
restoreArmed = false;
|
|
861
863
|
// ---- thresholds ----
|
|
862
864
|
$topThreshold = input(0, ...(ngDevMode ? [{ debugName: "$topThreshold" }] : []));
|
|
863
865
|
$bottomThreshold = input(0, ...(ngDevMode ? [{ debugName: "$bottomThreshold" }] : []));
|
|
@@ -909,6 +911,7 @@ class StableScrollDirective {
|
|
|
909
911
|
}
|
|
910
912
|
/** Call BEFORE data changes */
|
|
911
913
|
captureBeforeChange() {
|
|
914
|
+
this.restoreArmed = true;
|
|
912
915
|
this.refreshAnchorSnapshot();
|
|
913
916
|
}
|
|
914
917
|
/** Call AFTER render */
|
|
@@ -939,7 +942,7 @@ class StableScrollDirective {
|
|
|
939
942
|
if (!mutations.some((mutation) => mutation.addedNodes.length || mutation.removedNodes.length)) {
|
|
940
943
|
return;
|
|
941
944
|
}
|
|
942
|
-
if (!this.
|
|
945
|
+
if (!this.restoreArmed) {
|
|
943
946
|
this.refreshAnchorSnapshot();
|
|
944
947
|
return;
|
|
945
948
|
}
|
|
@@ -988,6 +991,7 @@ class StableScrollDirective {
|
|
|
988
991
|
this.restoreFrameId = requestAnimationFrame(() => {
|
|
989
992
|
this.restoreFrameId = null;
|
|
990
993
|
this.restoreFromSnapshot();
|
|
994
|
+
this.restoreArmed = false;
|
|
991
995
|
});
|
|
992
996
|
}
|
|
993
997
|
refreshAnchorSnapshot() {
|