-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution #2683
base: master
Are you sure you want to change the base?
Solution #2683
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on implementing the core functionality and meeting the task requirements! 🎉 The form validation, error handling, and state management are well-executed, and your attention to detail is evident. Keep up the excellent work, and continue refining your skills! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
<form | ||
className="NewMovie" | ||
key={count} | ||
onSubmit={handleFormSubmit} | ||
onReset={reset} | ||
> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider implementing onBlur
validation for required fields to show errors and a red border if the input is invalid. This is part of the task requirements to ensure fields are validated when they lose focus.
disabled={ | ||
!isValid(title) || | ||
!isValid(imgUrl) || | ||
!isValid(imdbUrl) || | ||
!isValid(imdbId) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the submit button is disabled until all required fields are filled with valid, trimmed values. This is a task requirement to prevent submission of incomplete data.
<form className="NewMovie" key={count}> | ||
<form | ||
className="NewMovie" | ||
key={count} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the form's key to reinitialize it after resetting to clear errors. This is necessary to ensure errors are not shown after clearing the form, as per the task requirements.
DEMO LINK