Skip to content

Commit c4500de

Browse files
authored
Bind the correct this context to chat's callback methods passed down to <markdown-stream> (#1866)
1 parent bc07d2c commit c4500de

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

js/chat/chat.ts

Lines changed: 2 additions & 2 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
}

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)