You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a required field using the CKEditor5Widget within a form that does not specify novalidate, the console throws this error on submit:
This happens whether or not the ckeditor field is empty because the textarea is not filled until after submit.
The expected behavior would be for the ckeditor field that replaces the textarea to work with HTML validation. Either way, this should be documented.
Potential Partial Fix:
On editor creation, add an event listener to populate the textarea while the ckeditor is being worked in (on input or change). I believe this would prevent the error from blocking submits if the ckeditor has content in it when a field is required. It would not solve the issue when there is an error detected in the ckeditor/textarea.
The text was updated successfully, but these errors were encountered:
I agree, this should be documented. Is there any real benefit on having the brower side validation for the ckeditor field though? We could add formnovalidate to the widget template I think, this way you don't need to add novalidate to the whole form if you want to keep the browser validation for the other form fields.
@goapunk I think you are right that having browser side validation is not necessary. In my own project, we ended up setting Django's use_required_attribute to False, which is recommended in the Django documentation. I think formnovalidate would work as well.
When I create a required field using the CKEditor5Widget within a form that does not specify
novalidate
, the console throws this error on submit:This happens whether or not the ckeditor field is empty because the textarea is not filled until after submit.
The expected behavior would be for the ckeditor field that replaces the textarea to work with HTML validation. Either way, this should be documented.
Potential Partial Fix:
On editor creation, add an event listener to populate the textarea while the ckeditor is being worked in (on input or change). I believe this would prevent the error from blocking submits if the ckeditor has content in it when a field is required. It would not solve the issue when there is an error detected in the ckeditor/textarea.
The text was updated successfully, but these errors were encountered: