This will be a familiar frustration for those who use templates in TinyMCE: inserting a template, and then not being able to get the cursor out of a block if it was nested or at the very end of the document, unless you inserted white space or other tags after too. That's not ideal.
This change enables an existing tinyMCE parameter, end_container_on_empty_block, which allows you to exit out of those blocks intentionally by pressing enter
twice.
Open somewhere with an editor field. Toggle to turn off the editor and insert the following HTML (as the ONLY content):
<div class="parent" style="background-color: #ddd; padding: 1em;">
<div class="child" style="background-color: #efefef; padding:1em;">
<p>Text goes here.</p>
</div>
</div>
Toggle the editor and turn it back on. Optionally enable block visibility for better understanding of which div you are in.
Then, try to use the arrow keys or enter key to get out of the child and parent divs.
You can't. You're stuck in the child div forever.
Pressing enter twice exits the child div and you can enter content in the parent div.
Pressing enter another two times exits the parent div and you can now add text in the main editor without blocks.
Please select:
Category | ⇒ | Front End Plugins |
Thanks @brianteeman , updated it!
Has the build stuff broken? It's been pending a long time
Labels |
Added:
?
|
I tested this and it works like expected. I think it should be added to the documentation, though. (I dont see any test this button in issues.joomla.org) thats why I am only commenting.
@richard67 do you have any idea why there wouldn't be a "test this" button on the issues site? I can't confirm since I am the author
@crystalenka A bug with the issue tracker which happens from time to time. The tracker treats the PR as if it was an issue and so doesn't show the button. Solution is either people report back their test result with a comment and we (maintainers or JBS) have a look on it and set it RTC when it has 2 tests reported in that way. Or you make a new PR and close this one.
Okay. Elisa tested it successfully, I'm not sure if @brianteeman or @wilsonge did?
@crystalenka By the way: Is your cursor named Willy?
@crystalenka By the way: Is your cursor named Willy?
That joke took me too long, I would admit to.
Tested following the instruction and it works as described. We need a documentation for this change as it is not very known or self-explaining.
Status | New | ⇒ | Ready to Commit |
RTC
@chmst Assuming your comment above is a successful test, I have set RTC as that was the 2nd test.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-12-29 13:09:06 |
Closed_By | ⇒ | roland-d |
Thank you
LGTM - please note the link to the tiny docs you gave is for tiny6 where this option is enhanced. The correct link for tiny5 is https://www.tiny.cloud/docs/configure/advanced-editing-behavior/#end_container_on_empty_block