newbthenewbd / grav-plugin-tinymce-editor

TinyMCE Editor Integration Plugin for Grav
Other
60 stars 10 forks source link

An invalid form control with name='data[field][name]' is not focusable. #40

Closed localnetwork closed 5 years ago

localnetwork commented 5 years ago

This happens when i set the validate required to true.

jazzyjube commented 5 years ago

Same problem here ...

jazzyjube commented 5 years ago

Found a quick fix :

Add this line of code at line 54 in the following file: user/plugins/tinymce-editor/templates/forms/fields/tinymce/tinymce.html.twig

$( "button.button[value='save']" ).one("click", function( event ) {
                tinymce.triggerSave();
                    $( this ).off( event );
            });

Add some CSS to disable the console message "An invalid form control with.." and enable the HTML 5 message showing when a field is required.

In order to do that, you'll need some CSS at the end of the following file : /user/plugins/tinymce-editor/css/editor.css

textarea.tinymce { display: block !important; margin-top: -56px !important; }

Hope this will help !

newbthenewbd commented 5 years ago

Fixed in v1.2.7, looks like for TinyMCE the serverside validation will have to do the job.

Thanks for reporting!