Upodate.
This commit is contained in:
		
							parent
							
								
									3130933ea4
								
							
						
					
					
						commit
						934f334b91
					
				@ -59,12 +59,13 @@ class MessageList extends HTMLElement {
 | 
				
			|||||||
      return this.isElementVisible(this.querySelector(".message-list-bottom"));
 | 
					      return this.isElementVisible(this.querySelector(".message-list-bottom"));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  scrollToBottom(force) {
 | 
					  scrollToBottom(force) {
 | 
				
			||||||
    this.scrollTop = this.scrollHeight;
 | 
					    //this.scrollTop = this.scrollHeight;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          this.querySelector(".message-list-bottom").scrollIntoView();
 | 
				
			||||||
    this.querySelector(".message-list-bottom").scrollIntoView();
 | 
					    this.querySelector(".message-list-bottom").scrollIntoView();
 | 
				
			||||||
      setTimeout(() => {
 | 
					      setTimeout(() => {
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
        this.scrollTop = this.scrollHeight;
 | 
					  //      this.scrollTop = this.scrollHeight;
 | 
				
			||||||
          this.querySelector(".message-list-bottom").scrollIntoView();
 | 
					          this.querySelector(".message-list-bottom").scrollIntoView();
 | 
				
			||||||
      },200)
 | 
					      },200)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -80,7 +81,7 @@ class MessageList extends HTMLElement {
 | 
				
			|||||||
    const html = receivedHtml.querySelector(".text").innerHTML;
 | 
					    const html = receivedHtml.querySelector(".text").innerHTML;
 | 
				
			||||||
    const textElement = messageDiv.querySelector(".text");
 | 
					    const textElement = messageDiv.querySelector(".text");
 | 
				
			||||||
    textElement.innerHTML = html;
 | 
					    textElement.innerHTML = html;
 | 
				
			||||||
    messageDiv.style.display = message.text == "" ? "none" : "block";
 | 
					    textElement.style.display = message.text == "" ? "none" : "block";
 | 
				
			||||||
    if(scrollToBottom)
 | 
					    if(scrollToBottom)
 | 
				
			||||||
      this.scrollToBottom(true)
 | 
					      this.scrollToBottom(true)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user