From b9e88690acd7e4a2208f1d7e76bf46ea8dc41ca5 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Tue, 12 Nov 2024 15:34:43 +0100 Subject: [PATCH] feat(Assistant): We want to scroll down to the sources button when it is displayed --- src/assistant/Conversations/Sources/Sources.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/assistant/Conversations/Sources/Sources.jsx b/src/assistant/Conversations/Sources/Sources.jsx index b7434504c..dbb92d924 100644 --- a/src/assistant/Conversations/Sources/Sources.jsx +++ b/src/assistant/Conversations/Sources/Sources.jsx @@ -22,6 +22,11 @@ const Sources = ({ messageId, files }) => { setShowSources(v => !v) } + // we want to scroll down to the sources button when it is displayed + useEffect(() => { + ref.current?.scrollIntoView(false) + }, []) + useEffect(() => { if (showSources) { const sourcesBottom = ref.current.getBoundingClientRect().bottom