BoomyJee
BoomyJee

Reputation: 61

Tinymce: can't insert any outer content when single div is present

When creating tinymce with following content

<div><p>123</p></div>

you can't edit any content outside that div.

I can't find a way to add something before or after the div. Is this could be fixed somehow programmatically?

Here is sample (i styled div to show the problem): http://fiddle.tinymce.com/n3caab

Upvotes: 2

Views: 1332

Answers (2)

Lev Zadumkin
Lev Zadumkin

Reputation: 33

Now 2017, and the problems are the same. Found a simple way - insert mnemonic &zwj; on the sides of the div. Unlike &nbsp; this does not take up too much content. Meanwhile, ckeditor solved this problem with tooltip "insert paragraph here".

Upvotes: 1

user35443
user35443

Reputation: 6413

If you want to make user avaible to write on the start or end of content, just simply add &nbsp; on where it's needed.

There's a way how to avoid user to delete them. You can write javascript function and set it to execute when content is being changed. The function can check if the user isn't doing what he shouldn't.

You can also make special button on tinmce panel for it. I think that solution before is more elegant, but it can also have it's problems.

Upvotes: 0

Related Questions