Open geonanorch opened 6 years ago
@geonanorch I'll take a look at this in more depth soon as I can but as a short term solution I'd suggest disabling _preventEmptyRegions()
when you setContent
as a possible work around, e.g:
editor._emptyRegionsAllowed = true
editor.regions().main.setContent(html)
editor._emptyRegionsAllowed = false
OK, thank you @anthonyjb . Leaving the issue open for the long-term solution ;-)
I am trying to set up ContentTool to edit multiple zones via a shared popup editor:
I am having some trouble with
Region.setContent()
. It seems that after detaching the previous elements of the region, it adds back an empty element before adding the new content provided through the parameter. This results in an extra empty line at the beginning of the content.I could trace the call down to
NodeCollection.prototype.detach()
then further to_handleDetach()
which is calling_preventEmptyRegions()
, which ought not to be called unless I missed something.I used release 1.5.4 but same behavior with
master
. Tested with Firefox 54.0.1.