File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
frontend/src/components/app/matches Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1111 <h1 class =" noSelect capitalize opacity-50" >←</h1 >
1212 </div >
1313 </div >
14- <div v-if =" messages" class =" messages break-words rounded-md overflow-scroll pt-4 pb-2 w-full" >
14+ <div id = " messageBox " v-if =" messages" class =" messages my-2 break-words rounded-md overflow-scroll w-full" >
1515 <h1 v-for =" message in messages" :key =" message.id"
1616 v-bind:class =" {
1717 'py-2': true,
@@ -67,6 +67,12 @@ export default {
6767 to_uid: this .user .id .toString (),
6868 content: this .message ,
6969 });
70+ this .messages .push ({ to_id: this .chatWithUserId , content: this .message });
71+ this .message = ' ' ;
72+ this .$nextTick (() => {
73+ const messageBox = document .getElementById (' messageBox' );
74+ messageBox .scrollTop = messageBox .scrollHeight ;
75+ });
7076 },
7177 },
7278 async beforeMount () {
@@ -75,6 +81,10 @@ export default {
7581 const userRequest = await this .$http .get (` /users/${ this .chatWithUserId } ` );
7682 this .user = userRequest .data ;
7783 this .loggedInUserId = this .$store .getters .getLoggedInUser .id ;
84+ this .$nextTick (() => {
85+ const messageBox = document .getElementById (' messageBox' );
86+ messageBox .scrollTop = messageBox .scrollHeight ;
87+ });
7888 },
7989};
8090 </script >
You can’t perform that action at this time.
0 commit comments