0

Usually the Botframework Webchat scrolls down on a new message, if the user didn't scroll up manually. Otherwise a button appears at the bottom right which lets you scroll down to the new message.

I would like to scroll down automatically, always. Currently I'm using this middleware that doesn't work well:

    if (action.type === 'DIRECT_LINE/INCOMING_ACTIVITY' && document.querySelector('ul[role="list"]').lastChild && !scrollBarIsAtBottom()) {
        document.querySelector('ul[role="list"]').lastElementChild.scrollIntoView(true);
        const selector = document.querySelector("[role=log]");
        if (selector && selector.lastElementChild && selector.lastElementChild.getAttribute('type') === 'button') {
            selector.lastElementChild.setAttribute("hidden", "true");
        }
    }

It scrolls down automatically before the chat or card is fully rendered. The user has to scroll down manually again.
Is there a way to scroll down automatically after rendering?

We're using version 3 of the Botframework Webchat.

ndueck
  • 713
  • 1
  • 8
  • 27
  • Does this answer your question? [Microsoft BotFramework-WebChat scrolling issues](https://stackoverflow.com/questions/55121857/microsoft-botframework-webchat-scrolling-issues) – Ecstasy Mar 29 '22 at 05:54
  • [Feature Request: Ability to customize scroll behaviour in WebChat V4](https://github.com/microsoft/BotFramework-WebChat/issues/2884) – Ecstasy Mar 29 '22 at 05:55

0 Answers0