Spaces:
Running
Running
fix: prevent empty submits (#1501)
Browse files
src/lib/components/chat/ChatInput.svelte
CHANGED
@@ -41,7 +41,9 @@
|
|
41 |
value = value.substring(0, start) + "\n" + value.substring(end);
|
42 |
textareaElement.selectionStart = textareaElement.selectionEnd = start + 1;
|
43 |
} else {
|
44 |
-
|
|
|
|
|
45 |
}
|
46 |
}
|
47 |
}
|
|
|
41 |
value = value.substring(0, start) + "\n" + value.substring(end);
|
42 |
textareaElement.selectionStart = textareaElement.selectionEnd = start + 1;
|
43 |
} else {
|
44 |
+
if (value.trim() !== "") {
|
45 |
+
dispatch("submit");
|
46 |
+
}
|
47 |
}
|
48 |
}
|
49 |
}
|