Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

Strange effects when copying content of specific elements into contenteditable element #17

Open
Narretz opened this issue Nov 20, 2013 · 1 comment

Comments

@Narretz
Copy link
Contributor

Narretz commented Nov 20, 2013

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.

@johnlim5847
Copy link

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);
});
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants