-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
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
-
Use the latest Web Chat bundle from CDN:
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
-
Initialize Web Chat with:
const styleOptions = { autoScrollSnapOnActivity: 1 }; WebChat.renderWebChat({ directLine, styleOptions }, document.getElementById('webchat'));
-
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