I've found the solution.
Basically when you sort the list the the content of the div get hidden. which blocks the htmlarea content. There are number of issues logged in the jHTMLArea forum regarding this.
What I did is when you dropped the div I've re rendered the HTMLArea.
Here is the working demo.
$('textarea').htmlarea();
var fixHelperModified = function (e, tr) {
var $originals = tr.children();
var $helper = tr.clone(true, true);
$helper.children().each(function (index) {
$(this).width($originals.eq(index).width())
});
return $helper;
},
updateIndex = function (e, ui) {
$('td.index', ui.item.parent()).each(function (i) {
$(this).html(i + 1);
});
ui.item.find('textarea').htmlarea('dispose');
ui.item.find('textarea').htmlarea();
};
$("#sort TBODY").sortable({
helper: fixHelperModified,
stop: updateIndex
}).disableSelection();
Example problems