Closed Letssharearow closed 1 year ago
I thought I already implemented this. Does it never work for you? Can you add what browser you are using?
I am using chrome. I disabled my extension, reproduced it, tried to reproduce it with recording, coudln't reproduce it. I will come back to this, when I have the issue again
I wrote this tempermonkey script for me to scroll automatically
`// ==UserScript== // @name Tac // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://tac-with-bug.herokuapp.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=herokuapp.com // @grant none // ==/UserScript==
(function () { "use strict"; console.log("Tac");
function scrollText(e) { console.log("DOMNodeInserted", e); const inputLength = e.target.querySelector("textarea")?.textContent.length; console.log("inputLength", inputLength); if (inputLength && inputLength <= 0) { e.target.scrollHeight = e.target.scrollTop; } }
function onClickSetDomListener() { const messagesContainer = document.querySelector(".chatBodyMessages"); messagesContainer.removeEventListener("DOMNodeInserted", scrollText); messagesContainer.addEventListener("DOMNodeInserted", scrollText); }
window.addEventListener("click", onClickSetDomListener); })(); `