refac
This commit is contained in:
1 parent
413dcae8a2
commit
7d3efb8513
2 files changed
+33
-1
No files matched your search
@@ -140,7 +140,16 @@
|
||||
|
||||
const scrollToBottom = () => {
|
||||
const element = document.getElementById('messages-container');
|
||||
element.scrollTop = element.scrollHeight;
|
||||
if (element) {
|
||||
element.scrollTop = element.scrollHeight;
|
||||
|
||||
// Follow-up scroll to account for content-visibility: auto re-layouts
|
||||
requestAnimationFrame(() => {
|
||||
if (element) {
|
||||
element.scrollTop = element.scrollHeight;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const scrollToTop = async () => {
|
||||
|
||||
Reference in new issue
Block a user