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
Describe the bug
When creating a markdown text editor using the SimpleMDE::make('editor')->required() method, the required attribute is automatically added to the underlying CodeMirror instance. This causes side effects, such as the field appearing empty if it hasn't been manually edited or when content is added via copy-paste. As a result, the form cannot be submitted, even though the field is technically filled.
To Reproduce
Steps to reproduce the behavior:
Create a markdown editor field using SimpleMDE::make('editor')->required().
Attempt to submit the form without manually editing the editor content.
Observe that the form submission is blocked due to the field being considered empty.
Copy and paste content into the editor and attempt to submit again. The same issue occurs.
Expected behavior
The form should be able to be submitted if the markdown editor field contains content, regardless of whether the content was manually typed or added via copy-paste.
Additional context
This issue seems to stem from the fact that the required attribute is being passed to the CodeMirror instance instead of just validating the presence of content in the underlying text area. One potential solution could be to manage the required validation via a custom validation rule in Laravel, rather than directly attaching it to the CodeMirror field.
As an open-source project, we truly rely on the community's support. If possible, we'd be incredibly grateful if you could submit a pull request with a fix and any relevant tests. 🛠️
Describe the bug
When creating a markdown text editor using the
SimpleMDE::make('editor')->required()
method, therequired
attribute is automatically added to the underlying CodeMirror instance. This causes side effects, such as the field appearing empty if it hasn't been manually edited or when content is added via copy-paste. As a result, the form cannot be submitted, even though the field is technically filled.To Reproduce
Steps to reproduce the behavior:
SimpleMDE::make('editor')->required()
.Expected behavior
The form should be able to be submitted if the markdown editor field contains content, regardless of whether the content was manually typed or added via copy-paste.
Additional context
This issue seems to stem from the fact that the
required
attribute is being passed to the CodeMirror instance instead of just validating the presence of content in the underlying text area. One potential solution could be to manage therequired
validation via a custom validation rule in Laravel, rather than directly attaching it to the CodeMirror field.platform/resources/js/controllers/simplemde_controller.js
Lines 152 to 155 in 357283f
The text was updated successfully, but these errors were encountered: