Skip to content

Commit

Permalink
fix: replace vanilla query with Lit query
Browse files Browse the repository at this point in the history
  • Loading branch information
anfibiacreativa committed Nov 6, 2023
1 parent a877fe8 commit f19ba29
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/chat-component/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export class ChatComponent extends LitElement {
@query('#question-input')
questionInput!: HTMLInputElement;

@query('#chat-list-footer')
chatFooter!: HTMLElement;

// Default prompts to display in the chat
@property({ type: Boolean })
isDisabled = false;
Expand Down Expand Up @@ -123,9 +126,8 @@ export class ChatComponent extends LitElement {
}
// handle must scroll event
handleOnMustScroll(): void {
const footer = this.shadowRoot?.querySelector('#chat-list-footer') as HTMLElement;
if (footer) {
scrollToFooter(footer);
if (this.chatFooter) {
scrollToFooter(this.chatFooter);
}
}
// Send the question to the Open AI API and render the answer in the chat
Expand Down

0 comments on commit f19ba29

Please sign in to comment.