@landtrustinc/design-system 1.2.27-beta.3 → 1.2.27-beta.4

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.d.ts CHANGED
@@ -1343,11 +1343,10 @@ type ChatWidgetProps = {
1343
1343
  };
1344
1344
  type ChatWidgetRef = {
1345
1345
  /**
1346
- * Scroll to a specific message by index
1346
+ * Scroll to a specific message by index, positioning it at the top of the scroll container
1347
1347
  * @param index - The index of the message in the messages array
1348
- * @param position - Where to position the message in the viewport ('start' | 'center' | 'end')
1349
1348
  */
1350
- scrollToMessageIndex: (index: number, position?: ScrollLogicalPosition) => void;
1349
+ scrollToMessageIndex: (index: number) => void;
1351
1350
  };
1352
1351
  declare const ChatWidget: React__default.ForwardRefExoticComponent<ChatWidgetProps & React__default.RefAttributes<ChatWidgetRef>>;
1353
1352
 
package/dist/index.js CHANGED
@@ -5955,14 +5955,12 @@ var ChatWidget = import_react30.default.forwardRef(
5955
5955
  (0, import_react30.useImperativeHandle)(
5956
5956
  ref,
5957
5957
  () => ({
5958
- scrollToMessageIndex: (index, position2 = "start") => {
5958
+ scrollToMessageIndex: (index) => {
5959
5959
  const messageEl = messageRefs.current[index];
5960
5960
  if (messageEl && scrollRef.current && isExpanded) {
5961
5961
  requestAnimationFrame(() => {
5962
- messageEl.scrollIntoView({ block: position2, behavior: "smooth" });
5963
- if (scrollRef.current) {
5964
- savedScrollPosition.current = scrollRef.current.scrollTop;
5965
- }
5962
+ scrollRef.current.scrollTop = messageEl.offsetTop;
5963
+ savedScrollPosition.current = messageEl.offsetTop;
5966
5964
  });
5967
5965
  }
5968
5966
  }