diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html
index 3a7a24c0..ffc37043 100644
--- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html
+++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-side.component.html
@@ -167,7 +167,9 @@
class="left-side-tabs-contents"
style="display: none;"
>
-
+
diff --git a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts
index 562865ff..5213b21a 100644
--- a/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts
+++ b/projects/ucap-webmessenger-app/src/app/layouts/messenger/components/left-sidenav/chat.component.ts
@@ -1,5 +1,12 @@
import { exit } from './../../../../store/messenger/room/actions';
-import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
+import {
+ Component,
+ OnInit,
+ OnDestroy,
+ ViewChild,
+ AfterViewChecked,
+ Input
+} from '@angular/core';
import {
ucapAnimations,
DialogService,
@@ -29,6 +36,8 @@ import { KEY_VER_INFO } from '@app/types';
import { LoginResponse } from '@ucap-webmessenger/protocol-authentication';
import { MatMenuTrigger } from '@angular/material';
import { FormGroup, FormBuilder } from '@angular/forms';
+import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
+import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar';
@Component({
selector: 'app-layout-chat-left-sidenav-chat',
@@ -36,7 +45,16 @@ import { FormGroup, FormBuilder } from '@angular/forms';
styleUrls: ['./chat.component.scss'],
animations: ucapAnimations
})
-export class ChatComponent implements OnInit, OnDestroy {
+export class ChatComponent implements OnInit, OnDestroy, AfterViewChecked {
+ @Input()
+ isVisible = true;
+
+ @ViewChild('cvsvChatList', { static: false })
+ cvsvChatList: CdkVirtualScrollViewport;
+
+ @ViewChild(PerfectScrollbarDirective, { static: false })
+ psDirectiveRef?: PerfectScrollbarDirective;
+
@ViewChild('chatContextMenuTrigger', { static: true })
chatContextMenuTrigger: MatMenuTrigger;
chatContextMenuPosition = { x: '0px', y: '0px' };
@@ -56,6 +74,9 @@ export class ChatComponent implements OnInit, OnDestroy {
recommendedWordList: string[];
filteredRecommendedWordList: string[];
+ /** 채팅 리스트에 virture scroll의 size check */
+ isInitList = false;
+
constructor(
private store: Store,
private formBuilder: FormBuilder,
@@ -133,6 +154,10 @@ export class ChatComponent implements OnInit, OnDestroy {
}
this.recommendedWordList = [...recommendedWordList];
+
+ if (!!this.psDirectiveRef) {
+ this.psDirectiveRef.update();
+ }
})
)
.subscribe();
@@ -156,6 +181,19 @@ export class ChatComponent implements OnInit, OnDestroy {
}
}
+ ngAfterViewChecked(): void {
+ if (
+ !!this.cvsvChatList &&
+ !!this.roomList &&
+ this.roomList.length > 0 &&
+ !this.isInitList &&
+ this.isVisible
+ ) {
+ this.isInitList = true;
+ this.cvsvChatList.checkViewportSize();
+ }
+ }
+
onClickSearchCancel() {
this.isSearch = false;
this.searchRoomList = [];