Skip to content

Commit 3dc26bd

Browse files
committed
Bind the correct this context to chat's callback methods passed down to <markdown-stream>
1 parent 0399bbd commit 3dc26bd

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

js/chat/chat.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class ChatMessage extends LightElement {
7272
content-type=${this.content_type}
7373
?streaming=${this.streaming}
7474
auto-scroll
75-
.onContentChange=${this.#onContentChange}
76-
.onStreamEnd=${this.#makeSuggestionsAccessible}
75+
.onContentChange=${this.#onContentChange.bind(this)}
76+
.onStreamEnd=${this.#makeSuggestionsAccessible.bind(this)}
7777
></shiny-markdown-stream>
7878
`;
7979
}
@@ -262,7 +262,6 @@ class ChatInput extends LightElement {
262262
}
263263

264264
class ChatContainer extends LightElement {
265-
266265
private get input(): ChatInput {
267266
return this.querySelector(CHAT_INPUT_TAG) as ChatInput;
268267
}

shiny/www/py-shiny/chat/chat.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shiny/www/py-shiny/chat/chat.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)