-
-
Notifications
You must be signed in to change notification settings - Fork 4
TinyMCE in Text Widget #273
Comments
Agreed, something looks incorrect here, I cant even get Text widgets to work fully nor errors to show locally. I think it should be using TinyMCE if you are happy to submit a PR @KTS915 |
I've been trying to test the PR #275 for this and couldn't get things working locally at all, until I reverted the changes we made in #240 - reversing that entire commit popped the TinyMCE editor back into existence for me on Text Widgets. Does that help in figuring this issue out? Is it worth reverting #240 and re-working that PR again? Would accept your suggestion here. |
I've just made one more change to PR #275. It seems that the previous changes have made everything so much quicker that it was just happening too fast for TinyMCE! So I have increased the delay before it goes to work from 50ms to 200ms. (I tried 100ms and it was inconsistent as to whether that was enough, so 200 seems safe). I think we should be good now. |
* Update script-loader.php to include scripts required to run TinyMCE in the text widget See Issue #273 * Update text-widgets.js to run TinyMCE editor * Update script-loader.php to remove unrelated code * Update text-widgets.js to add TinyMCE bypasses * Update text-widgets.js This uses a combination of vanilla JS and jQuery, but that's what the widget uses already. (Yes, the code we've inherited here is a real dog's breakfast.) At a later date we can work on replacing this with purely vanilla JS once we have it all working. This still leaves one thing not working correctly. If two Text widgets are added in the Customizer, the second won't open; that probably needs a fix in a different file. I will investigate. * Coding standards fix * Update script-loader.php in response to #275 (review) * Update text-widgets.js * Update customize-widgets.js to make TinyMCE work for all Text widgets in Customizer * Update text-widgets.js to delay instantiating TinyMCE for 200ms * Update widgets.css to prevent widgets expanding beyond container --------- Co-authored-by: mattyrob <[email protected]>
Expected behavior
Is TinyMCE supposed to be working in the Text widget? I don't use it normally but, as I'm working on something to do with widgets, I had cause to test it and found that Tiny doesn't work. (In fact, there's an error generated in the browser console.)
Current behavior
When opening a Text widget, the user can enter blank text only. There is no TinyMCE editor.
Possible solution
What's missing are some lines in the
~/wp-includes/script-loader.php
file and then some lines in the~wp-admin/js/widgets/text-widgets.js
file.I can provide a PR if we agree that Tiny is supposed to be working (which I think is what we want). If we don't want that, then some lines need removing from the
~wp-admin/js/widgets/text-widgets.js
file to avoid generating the current error.Steps to reproduce bug
Open a Text widget and see for yourself.
Context
No response
ClassicPress version
2.0.0+nightly.20231005
PHP version
8.1
Can you help?
Yes, I will submit a PR
The text was updated successfully, but these errors were encountered: