diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.scss b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.scss index dc8fdda2..d0265ade 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.scss +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/message-box.component.scss @@ -15,7 +15,6 @@ $tablet-s-width: 768px; .message-row { width: 100%; height: 100%; - margin-bottom: 20px; .date-splitter { display: block; width: 100%; @@ -26,6 +25,7 @@ $tablet-s-width: 768px; display: flex; flex-direction: row; margin-left: 0; + padding-bottom: 20px; .profile-img { flex: 0 0 auto; &.thumbnail-mask { diff --git a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts index 3bc75b7d..6f41fe00 100644 --- a/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts +++ b/projects/ucap-webmessenger-ui-chat/src/lib/components/messages.component.ts @@ -412,12 +412,12 @@ export class MessagesComponent implements OnInit, OnDestroy { } preSwapScroll(useHide: boolean, useSwap: boolean) { - if (useSwap && !this.swapped) { - this.chatMessagesBuffer.nativeElement.innerHTML = this.chatMessagesContainer.nativeElement.innerHTML; - this.chatMessagesBuffer.nativeElement.scrollTop = this.chatMessagesContainer.nativeElement.scrollTop; - this.chatMessagesBuffer.nativeElement.classList.remove('disappear'); - this.swapped = true; - } + // if (useSwap && !this.swapped) { + // this.chatMessagesBuffer.nativeElement.innerHTML = this.chatMessagesContainer.nativeElement.innerHTML; + // this.chatMessagesBuffer.nativeElement.scrollTop = this.chatMessagesContainer.nativeElement.scrollTop; + // this.chatMessagesBuffer.nativeElement.classList.remove('disappear'); + // this.swapped = true; + // } if (useHide && !this.hidden) { this.chatMessagesContainer.nativeElement.classList.add('hide'); @@ -426,12 +426,12 @@ export class MessagesComponent implements OnInit, OnDestroy { } postSwapScroll(useHide: boolean, useSwap: boolean) { - if (useSwap && this.swapped) { - this.chatMessagesBuffer.nativeElement.innerHTML = ''; - this.chatMessagesBuffer.nativeElement.scrollTop = 0; - this.chatMessagesBuffer.nativeElement.classList.add('disappear'); - this.swapped = false; - } + // if (useSwap && this.swapped) { + // this.chatMessagesBuffer.nativeElement.innerHTML = ''; + // this.chatMessagesBuffer.nativeElement.scrollTop = 0; + // this.chatMessagesBuffer.nativeElement.classList.add('disappear'); + // this.swapped = false; + // } if (useHide && this.hidden) { this.chatMessagesContainer.nativeElement.classList.remove('hide'); @@ -536,7 +536,7 @@ export class MessagesComponent implements OnInit, OnDestroy { if (this.scrollUpInitalized && this.eventRemained) { this.storeScrollPosition(); - this.preSwapScroll(true, true); + this.preSwapScroll(false, false); this.moreEvent.emit(this.eventList[0].seq);