Skip to content

Commit

Permalink
feat(Assistant): We want to scroll down to the sources button when it…
Browse files Browse the repository at this point in the history
… is displayed
  • Loading branch information
JF-Cozy committed Nov 12, 2024
1 parent f21251a commit 6581f7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/assistant/Conversations/Sources/Sources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6581f7f

Please sign in to comment.