Closed PiyushChandra17 closed 4 months ago
We have to think about the conditions where the validation error should and should not throw, and how those could be implemented. Here's my idea:
Right now we disable the "Add File" (submit) button until the form is valid. We would remove that condition such that the button is always clickable. We would only show validation error messages if the form has been submitted. We would not call the dispatch
when submitting unless the form is valid. If it has been submitted once and rejected, then we keep showing errors as they edit it until the input field is valid.
BTW the situations outlined about are something that we could write unit tests for, if anyone is interested in gaining testing experience.
Generally we don't show errors on a form unless it has been focused, but that doesn't do anything here because we automatically call .focus()
on the input so touched
is always true
.
p5.js version
2.10.2
What is your operating system?
Mac OS
Web browser and version
Chrome and 117.0.5938.132
Actual Behavior
Clicking on
cross
icon on create folder/create file modal throws validation error message for a whilehttps://github.com/processing/p5.js-web-editor/assets/47579287/e13225b6-ce76-44f0-8500-b802f88b15ea
Expected Behavior
Clicking on
cross
icon on create folder/create file modal should not throw validation error message for a while ( Perhaps clicking on anywhere outside thename
input box should display the validation error message)Steps to reproduce
Steps:
validation error
message displays for a while