bug of search is fixed

This commit is contained in:
richard-loafle 2020-02-06 16:00:56 +09:00
parent 7308940001
commit 91cc673d80

View File

@ -425,29 +425,39 @@ export class MessagesComponent implements OnInit, OnDestroy {
useSwap: boolean,
addtionalOffset?: number
) {
this.preSwapScroll(useHide, useSwap);
if (!!preCallback) {
preCallback();
}
this.virtualScroller.scrollInto(
to,
true,
undefined !== this.storedScrollItemOffsetTop
? -this.storedScrollItemOffsetTop
: undefined !== addtionalOffset
? -addtionalOffset
: 0,
0,
() => {
setTimeout(() => {
if (!!postCallback) {
postCallback();
}
this.postSwapScroll(useHide, useSwap);
});
if (!!to) {
this.preSwapScroll(useHide, useSwap);
if (!!preCallback) {
preCallback();
}
);
this.virtualScroller.scrollInto(
to,
true,
undefined !== this.storedScrollItemOffsetTop
? -this.storedScrollItemOffsetTop
: undefined !== addtionalOffset
? -addtionalOffset
: 0,
0,
() => {
setTimeout(() => {
if (!!postCallback) {
postCallback();
}
this.postSwapScroll(useHide, useSwap);
});
}
);
} else {
if (!!preCallback) {
preCallback();
}
if (!!postCallback) {
postCallback();
}
}
}
preSwapScroll(useHide: boolean, useSwap: boolean) {
@ -526,6 +536,10 @@ export class MessagesComponent implements OnInit, OnDestroy {
false
);
} else {
if (!this.eventList || 0 === this.eventList.length) {
return;
}
const lastEvent =
!!this.eventList && 0 < this.eventList.length
? this.eventList[this.eventList.length - 1]
@ -536,7 +550,9 @@ export class MessagesComponent implements OnInit, OnDestroy {
}
const isInViewPortItems = this.isInViewPortItems(lastEvent.seq);
this.swapScrollTo(
this.eventList[this.eventList.length - 1],
!!this.gotoEventSeq
? undefined
: this.eventList[this.eventList.length - 1],
() => {},
() => {
this.initalized = true;
@ -547,7 +563,7 @@ export class MessagesComponent implements OnInit, OnDestroy {
},
-1 === this.virtualScroller.viewPortInfo.endIndex ||
!isInViewPortItems,
!isInViewPortItems
!isInViewPortItems || !!this.gotoEventSeq
);
}
}