Fixed some scrolling issues when opening terminal

This commit is contained in:
BordedDev 2025-07-17 23:21:15 +02:00
parent 29b9fce07d
commit 3a4cf93bcc
3 changed files with 8 additions and 6 deletions

View File

@ -298,7 +298,9 @@ textToLeetAdvanced(text) {
this.appendChild(this.uploadButton);
this.textarea.addEventListener("blur", () => {
this.updateFromInput("");
this.updateFromInput(this.value, true).then(
this.updateFromInput("")
)
});
this.subscribe("file-uploads-done", (data)=>{
@ -417,7 +419,7 @@ textToLeetAdvanced(text) {
updateFromInput(value) {
updateFromInput(value, isFinal = false) {
this.value = value;
@ -425,7 +427,7 @@ textToLeetAdvanced(text) {
if (this.liveType && value[0] !== "/") {
const messageText = this.replaceMentionsWithAuthors(value);
this.messageUid = this.sendMessage(this.channelUid, messageText, !this.liveType);
this.messageUid = this.sendMessage(this.channelUid, messageText, !this.liveType || isFinal);
return this.messageUid;
}
}

View File

@ -191,9 +191,9 @@ class MessageList extends HTMLElement {
}
scrollToBottom(force = false, behavior= 'smooth') {
if (force || this.isScrolledToBottom()) {
this.firstElementChild.scrollIntoView({ behavior, block: 'end' });
this.firstElementChild.scrollIntoView({ behavior, block: 'start' });
setTimeout(() => {
this.firstElementChild.scrollIntoView({ behavior, block: 'end' });
this.firstElementChild.scrollIntoView({ behavior, block: 'start' });
}, 200);
}
}

View File

@ -115,7 +115,7 @@ app.starField.renderWord("H4x0r 1337")
{% endif %}
document.addEventListener("keydown", async() => {
document.addEventListener("keydown", async(event) => {
if(prevKey == "Escape"){
document.querySelector("chat-input").querySelector("textarea").value = "";
}