Skip to content

Server chat is not scrolling #2409

@staviq

Description

@staviq

I don't know if that's a firefox issue, or simply nobody noticed that so far, but the chat element has a js code to autoscroll but it's not working because it scrolls the wrong element.

Here is a quick fix, in the index.html, in the body of useEffect:

Old code:

if (container.current && container.current.scrollHeight <= container.current.scrollTop + container.current.offsetHeight + 300) {
          container.current.scrollTo(0, container.current.scrollHeight)
}

Working code:

if (container.current.parentElement && container.current.parentElement.scrollHeight <= container.current.parentElement.scrollTop + container.current.parentElement.offsetHeight + 300) {
          container.current.parentElement.scrollTo(0, container.current.parentElement.scrollHeight)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions