Skip to content

Commit 6830a6a

Browse files
committed
fix: dispatch input event when setting value to the textarea
1 parent f2582db commit 6830a6a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

_build/js/src/ui/localChat/modalInput.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ export const buildModalInput = (config: LocalChatConfig) => {
4141
textarea.value = value;
4242
textarea.focus();
4343

44-
if (value.trim() !== '') {
45-
sendBtn.disabled = false;
46-
applyStyles(sendBtn, 'active');
47-
} else {
48-
sendBtn.disabled = true;
49-
applyStyles(sendBtn, '');
50-
}
44+
textarea.dispatchEvent(new Event('input', { bubbles: true, cancelable: true }));
5145
};
5246

5347
const loading = createElement(

assets/components/modai/js/modai.js

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

0 commit comments

Comments
 (0)