emilianotisato / nova-tinymce

Laravel Nova TinyMCE editor (with images upload capabilities!)
MIT License
116 stars 38 forks source link

Changing the errors prop removes the .mce-content-body class when using inline mode #26

Closed marijnhurkens closed 4 years ago

marijnhurkens commented 4 years ago

I'm struggling with the editor in inline mode. If I set the errors prop after initializing the .mce-content-body class disappears from the tag:

Before:

<div id="t98896t-0-e3d62039-b55d-4cef-b13f-cb5b1d5254ce" placeholder="t98896t" class="mce-content-body" contenteditable="true" style="position: relative;" spellcheck="false"><p>jb</p></div>

After setting the errors prop:

<div id="t98896t-0-e3d62039-b55d-4cef-b13f-cb5b1d5254ce" placeholder="t98896t" class="border-danger" contenteditable="true" style="position: relative;" spellcheck="false"><p><br></p></div>

As you can see the .mce-content-body class has been replaced by the .border-danger class.

Reproducible scenario:

  1. Add a field with inline set to true and required added as a rule:
NovaTinyMCE::make('test')->options([
                'inline' => true,
                'height'=> '500',
            ])->rules('required'),
  1. Save without content.
emilianotisato commented 4 years ago

Hello @marijnhurkens sorry the delay.

Did you solve it? Is still removing the class? Witch version of laravel and nova are you using??

marijnhurkens commented 4 years ago

Hi @emilianotisato, I didn't solve the issue because we switched back to the normal iframe mode. I think I was using the latest Nova and Laravel version at that time (which would be Nova v2.11.1).