I'm using your directive with bootstrap 3 and Angular 1.3. I've found that when I highlight text and click "Bold" (or any other formatting change) and then immediately save, the formatting changes are not saved.
Digging a little deeper, I noticed that clicking toolbar buttons does not trigger the event listener that copies changes back to the ng-model variable:
textarea.on('keyup mouseup', function() {
scope.$apply(function readViewText() {
var html = textarea.html();
if (html == '<br>') {
html = '';
}
ngModelController.$setViewValue(html);
});
});
That's find for command buttons that only set mode, but can lead to unexpected behavior for command buttons that modify text.
Changes are captured correctly as long as you click or type at least once inside the textarea before saving.
I'll keep messing with it and let you know if I find a fix before you have a chance to look at it.
I'm using your directive with bootstrap 3 and Angular 1.3. I've found that when I highlight text and click "Bold" (or any other formatting change) and then immediately save, the formatting changes are not saved.
Digging a little deeper, I noticed that clicking toolbar buttons does not trigger the event listener that copies changes back to the ng-model variable:
That's find for command buttons that only set mode, but can lead to unexpected behavior for command buttons that modify text.
Changes are captured correctly as long as you click or type at least once inside the textarea before saving.
I'll keep messing with it and let you know if I find a fix before you have a chance to look at it.