Skip to content

autoScrollSnap flags doesn't work above version 4.12 #5623

@js-writer

Description

@js-writer

Description

The autoScrollSnapOnActivity style option does not seem to work as expected.
According to the documentation, setting autoScrollSnapOnActivity: 1 should disable auto-scrolling after the first activity is rendered, but Web Chat continues to scroll automatically for subsequent bot messages.

Steps to reproduce

  1. Use the latest Web Chat bundle from CDN:

    <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
  2. Initialize Web Chat with:

    const styleOptions = {
      autoScrollSnapOnActivity: 1
    };
    WebChat.renderWebChat({ directLine, styleOptions }, document.getElementById('webchat'));
  3. Have the bot send multiple messages on connection (e.g., a welcome card followed by text).

Expected behavior

Auto-scroll should stop after the first activity (the first bot message).

Actual behavior

Web Chat continues to auto-scroll for all subsequent messages, ignoring the autoScrollSnapOnActivity setting.

Environment

  • Web Chat version: latest (from CDN)
  • Browser: Chrome / Edge (latest)
  • Integration type: plain JavaScript (non-React)
  • Reproducible in the sample HTML snippet below.

Minimal repro HTML

<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
  </head>
  <body>
    <div id="webchat"></div>
    <script>
      const directLine = WebChat.createDirectLine({ token: 'YOUR_TOKEN' });
      WebChat.renderWebChat(
        {
          directLine,
          styleOptions: { autoScrollSnapOnActivity: 1 }
        },
        document.getElementById('webchat')
      );
    </script>
  </body>
</html>

Additional notes

  • Tested with multiple version; behavior is consistent. Only on version 4.12.x it is working
  • Other autoScroll also doesn't work.

Would appreciate any clarification or fix in a future release.

Do you see any errors in console log?

No errors in console.

How to reproduce the issue?

Create chatbot.
Type messages.

What do you expect?

No auto scroll after first message (or other defined)

What actually happened?

Scroll is going to the bottom.

Do you have any screenshots or recordings to repro the issue?

No response

Adaptive Card JSON

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bot ServicesRequired for internal Azure reporting. Do not delete. Do not change color.bugIndicates an unexpected problem or an unintended behavior.customer-reportedRequired for internal Azure reporting. Do not delete.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions