disable form if too long

This commit is contained in:
Brandon Thomas committed 2022-11-18 06:35:41 -05:00
1 parent 596f4b6436
commit 53f554d0be
1 file changed
+3 -3
@@ -179,9 +179,6 @@ function TtsModelListPage(props: Props) {
listTtsCategories();
}, [listModels, listTtsCategories]);
// TODO: I never did anything with this.
let remainingCharactersButtonDisabled = false;
const handleChangeText = (ev: React.FormEvent<HTMLTextAreaElement>) => {
const textValue = (ev.target as HTMLTextAreaElement).value;
props.setTextBuffer(textValue);
@@ -353,6 +350,9 @@ function TtsModelListPage(props: Props) {
}
}
// NB: If the text is too long, don't allow submission
let remainingCharactersButtonDisabled = props.textBuffer.trim().length > 1024;
return (
<motion.div initial="hidden" animate="visible" variants={container}>
{bootstrapLanguageNotice}