reachat 2.1.0-alpha.2 → 2.1.0-alpha.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.
@@ -1868,18 +1868,19 @@ ${response}`),
1868
1868
  children,
1869
1869
  newSessionContent,
1870
1870
  limit = 10,
1871
- showMoreText = "Show more"
1871
+ showMoreText = "Show more",
1872
+ autoScroll = true
1872
1873
  }) => {
1873
1874
  const { activeSession, theme } = React.useContext(ChatContext);
1874
1875
  const contentRef = React.useRef(null);
1875
1876
  const [isAnimating, setIsAnimating] = React.useState(true);
1876
1877
  React.useEffect(() => {
1877
- if (contentRef.current) {
1878
+ if (contentRef.current && autoScroll) {
1878
1879
  requestAnimationFrame(
1879
1880
  () => contentRef.current.scrollTop = contentRef.current.scrollHeight
1880
1881
  );
1881
1882
  }
1882
- }, [activeSession, isAnimating]);
1883
+ }, [activeSession, autoScroll, isAnimating]);
1883
1884
  function handleShowMore() {
1884
1885
  showNext(limit);
1885
1886
  requestAnimationFrame(() => contentRef.current.scrollTop = 0);