Skip to content

Commit 72f15fd

Browse files
committed
fix(chat): check message validity on button click
1 parent b08bc9c commit 72f15fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

assets/js/chat.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,12 @@ async function askChatBot(question) {
105105
// --------------------
106106
async function sendMessage() {
107107
const input = $('chat-form-input');
108-
const message = input?.value.trim();
108+
if (!input.checkValidity()) {
109+
input.reportValidity();
110+
return;
111+
}
109112

113+
const message = input?.value.trim();
110114
if (!message) return;
111115

112116
lockInput();

0 commit comments

Comments
 (0)