Open htrex opened 6 years ago
This was a contribution done a while back to allow rich text to happen on the inner_content automatically. I don't have a way to disable it by choice, sorry.
The actual bug is not seeing the rich text when you re-open the overlay.
If someone wants to contribute having an possibility to opt out from automatic inner_content, I'm OK to test it and release it.
I was able to reproduce the bug @mehigh mentioned above by:
Clicking on a shortcode in the Build Shortcode modal and closing the modal. On trying to insert a new shortcode with the inner_content field, TinyMCE does not load on the field.
This was triggering the error below yesterday, but I can't duplicate this particular JS error today. Despite not being able to duplicate the error, TinyMCE does still not load.
Uncaught TypeError: Cannot read property 'getRng' of undefined at m (tinymce.min.js?ver=4607-20180123:11) at Object.o [as focus] (tinymce.min.js?ver=4607-20180123:11) at q.focus (tinymce.min.js?ver=4607-20180123:14) at Object.p [as execCommand] (tinymce.min.js?ver=4607-20180123:11) at q.execCommand (tinymce.min.js?ver=4607-20180123:14) at Object.execCommand (tinymce.min.js?ver=4607-20180123:14) at richtext.js?ver=0.1:73
We added the following code "richText.unload( textarea_id );" at line 57 and this resolved issue and TinyMCE loads on the inner_content fields of all shortcodes on the page (new and on edit).
Attempted to create a branch, push, and open PR for this issue but access was denied.
@dollup Can you issue a PR and I'll get it merged in.
I'm seeing the bug in the subject. After clicking the insert element button and choosing a shortcake element, the inner_content field is shown as a rich text field using the tinyMCE editor. Closing the media window and repeating the same steps for a second or more times without reloading the post editing page shows the correct plain text inner_content field. If I disable wp-shortcode-ui-richtext plugin the bug is not present.
Here follows the code I'm using to register the shortcode.