@landtrustinc/design-system 1.2.7 → 1.2.8-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -5514,8 +5514,10 @@ var ChatWidget = ({
5514
5514
  const messagesChanged = messages.length !== previousMessagesLength.current;
5515
5515
  previousMessagesLength.current = messages.length;
5516
5516
  if (messagesChanged || isThinking) {
5517
- el.scrollTo({ top: el.scrollHeight, behavior: "smooth" });
5518
- savedScrollPosition.current = el.scrollHeight;
5517
+ requestAnimationFrame(() => {
5518
+ el.scrollTo({ top: el.scrollHeight, behavior: "smooth" });
5519
+ savedScrollPosition.current = el.scrollHeight;
5520
+ });
5519
5521
  }
5520
5522
  }, [messages, isThinking, isExpanded]);
5521
5523
  const messagesToRender = messages.length === 0 ? emptyState : messages;