When the admin wants to add new product category, the enabled switch was initially undefined. Due to which the enabled switch had to be pressed twice to make it true otherwise it shows error while submitting the form. I resolved it by assigning initial values of enabled so that admin does not get validation error while submitting the form.
Related Issues
The form displayed an error message saying "Please enter enabled" when initially rendered. This was due to the 'enabled' field not having a initial value set, causing validation to fail on initial page load.
Steps to Test
Go to productCategory
Click on Add new and add the name ,description ,color
Submit and the error "Please enter Enabled" is gone.(Previously you have to click the switch twice to make the enabled value to be true)
Testing
Verified that the form loads without showing the "Please enter enabled" error message.
Tested various form submissions to ensure validation works as expected with the initial value set to true.
Description
When the admin wants to add new product category, the enabled switch was initially undefined. Due to which the enabled switch had to be pressed twice to make it true otherwise it shows error while submitting the form. I resolved it by assigning initial values of enabled so that admin does not get validation error while submitting the form.
Related Issues
The form displayed an error message saying "Please enter enabled" when initially rendered. This was due to the 'enabled' field not having a initial value set, causing validation to fail on initial page load.
Steps to Test
Testing