@haloduck/ui 2.0.25 → 2.0.26
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.
package/fesm2022/haloduck-ui.mjs
CHANGED
|
@@ -3054,17 +3054,20 @@ class TableComponent {
|
|
|
3054
3054
|
for (const entry of entries) {
|
|
3055
3055
|
if (!entry.isIntersecting)
|
|
3056
3056
|
continue;
|
|
3057
|
-
|
|
3058
|
-
|
|
3057
|
+
const container = this.scrollContainer?.nativeElement;
|
|
3058
|
+
const allowWithoutScroll = !container || container.scrollHeight <= container.clientHeight;
|
|
3059
|
+
if (!this.hasObservedOnce && !allowWithoutScroll) {
|
|
3060
|
+
// 내부 스크롤 컨테이너가 있고 첫 교차는 무시
|
|
3059
3061
|
this.hasObservedOnce = true;
|
|
3060
3062
|
continue;
|
|
3061
3063
|
}
|
|
3062
|
-
// 마지막 키가 존재, 로딩 아님, 그리고 실제
|
|
3064
|
+
// 마지막 키가 존재, 로딩 아님, 그리고 (실제 스크롤 발생 or 스크롤 불필요)일 때만 로드
|
|
3063
3065
|
Promise.all([
|
|
3064
3066
|
firstValueFrom(this.lastEvaluatedKey.pipe(take(1))),
|
|
3065
3067
|
firstValueFrom(this.isLoading.pipe(take(1))),
|
|
3066
3068
|
]).then(([lastKey, isLoading]) => {
|
|
3067
|
-
|
|
3069
|
+
const scrolledOk = this.didScrollSinceLastLoad || allowWithoutScroll;
|
|
3070
|
+
if (!(lastKey && !isLoading && scrolledOk)) {
|
|
3068
3071
|
return;
|
|
3069
3072
|
}
|
|
3070
3073
|
// 중복 호출 방지: 즉시 관찰 해제 후 로드 트리거
|