Open farhansyakir opened 7 years ago
@farhansyakir do you have time for a PR?¿
This would be my solution (untested) https://gist.github.com/Deele/bf7837fb8bdaf5213d06c81a40ec04e9
Checking @Deele Thanks for this
I´ve made a similar PR to fix this issue. #45
@Eseperio with the fix, I'm still experiencing wierd behavior in Firefox (latest). Without the fix, TinyMCE does not initialize the 2nd time. But with the fix, the TinyMCE stays empty on 2nd initialisations. Only by adding a setTimeout around the init, it will fill up with the actual content. Chrome does not experience this behavior. Are you seeing the same behavior in your application?
when you combine tabular form and widget tinymce like this
<attribute> => [ 'type' => TabularForm::INPUT_WIDGET, 'widgetClass'=>\dosamigos\tinymce\TinyMce::classname(), ],
the old tinymce will not appear when you click add, so I suggest to add this code to reinit the tinymce
$js[] = "tinymce.EditorManager.execCommand('mceRemoveEditor',true, '$id');";
in dosamigos\tinymce\TinyMce
right above the
$js[] = "tinymce.init($options);";
thank you