diff --git a/FU.SPA/src/components/PostForm.jsx b/FU.SPA/src/components/PostForm.jsx index 52489ff8..8cd9314e 100644 --- a/FU.SPA/src/components/PostForm.jsx +++ b/FU.SPA/src/components/PostForm.jsx @@ -81,13 +81,13 @@ const PostForm = ({ onSubmit, submitButtonText, initialValue }) => { // Handles title state error const handleTitleChange = (e) => { - if (e.target.value < 3) { + if (e.target.value.length < 3 && e.target.value.length > 0) { setTitleError('Title must be longer than 3 characters'); setTitle(e.target.value); } else { - setTitle(e.target.value); setTitleError(''); } + setTitle(e.target.value); }; // Handles start date state error @@ -198,7 +198,7 @@ const PostForm = ({ onSubmit, submitButtonText, initialValue }) => {