angular-contenteditable icon indicating copy to clipboard operation
angular-contenteditable copied to clipboard

Strange effects when copying content of specific elements into contenteditable element

Open Narretz opened this issue 11 years ago • 1 comments

Hi, I'm not sure if this is an issue which is related to the module per se, but it even if not, maybe you have an idea what's going on here.

http://plnkr.co/edit/d0hZx45mvLzn3OCdLg4h?p=preview

Steps:

  1. select & copy "heading"
  2. paste it into the contenteditable field
  3. When you have heading and paste it into contenteditable heading or p, out of nowhere completely new dom nodes are created for each paste element, not inside the contenteditable element, but as siblings to it.

Browser is FF25.

Narretz avatar Nov 20 '13 13:11 Narretz

i think this is what you need https://github.com/johnlim5847/angular-contenteditable

// clear paste data element.bind('paste', function(e){ setTimeout(function() { scope.$apply(function() { ngModel.$setViewValue(e.target.innerText); }); element.html(ngModel.$viewValue); }); });

johnlim5847 avatar Dec 24 '13 14:12 johnlim5847