Skip to content

Commit

Permalink
fix: wrong scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
rjborba committed Jul 29, 2024
1 parent 2f7aea2 commit 5e03803
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ export class OramaChat {
chatContext.sourceBaseURL = this.sourceBaseUrl
}

componentDidUpdate() {
if (chatContext.lockScrollOnBottom && !this.isScrolling) {
this.scrollToBottom({ animated: false })
}
}

handleSubmit = (e: Event) => {
e.preventDefault()

Expand All @@ -125,10 +131,6 @@ export class OramaChat {
const lastInteractionStatus = lastInteraction?.status
const lastInteractionStreaming = lastInteractionStatus === TAnswerStatus.streaming

if (chatContext.lockScrollOnBottom && !this.isScrolling) {
this.scrollToBottom({ animated: false })
}

// ? Question: Maybe should be a orama-button variant?
return (
<Host>
Expand Down

0 comments on commit 5e03803

Please sign in to comment.