angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 371 forks source link

Poor Performance With Lots Of Text #224

Open abtincbrians opened 8 years ago

abtincbrians commented 8 years ago

I'm running into an issue where users need to be able to copy & paste + type large amounts of text for a given field of data, such as a report description.

Once a large amount of text has been entered, when typing, the WYSIWYG editor begins to lag significantly, making it almost unusable. The problem seems to affect at least Chrome and IE, but probably most/all browsers.

I'll include a link to a Plunker demonstrating the issue. Run the code, then start typing in the WYSIWYG on the right hand side. The faster you type, the more you'll notice the lag. Now clear all the text out, and start typing again. You'll see the lag is gone. While this example is kind of extreme, the problem is, on Internet Explorer, and on less performant systems, the threshold for "large" amounts of text is as low as 50 words before the lag starts to make the WYSIWYG unusable. Also note, that this doesn't seem to be an issue when using only TinyMCE (sans Angular & ui-tinymce).

Plunker: https://plnkr.co/edit/mpRJHBr67962YqWdJ4UF

Let me know if I can provide any more info to help, or if you have suggestions on a workaround or fixes.

deeg commented 8 years ago

Do you notice these issues on TinyMCE's demo pages without the use of our library?

abtincbrians commented 8 years ago

It does not happen on the demo pages, only when using ui-tinymce directive.

deeg commented 8 years ago

Thanks for reporting, I do see the same thing you are seeing.

I will look into this, but I'm not sure what is causing it off the top of my head. Going to mark it as an enhancement since nothing is really broken.

If you have any fixes please feel free to put out a PR.

abtincbrians commented 8 years ago

Pull request issued, please review and advise, thanks.

deeg commented 8 years ago

Although a pull request making this issue better has been merged in, I am going to leave the ticket open for now to see if we can improve upon it even more.

lauraerinmann commented 8 years ago

Having a similar issue. Anyone have other thoughts on how to improve performance here? I'm a little stumped. Though the problem seems to be the ed.on ('something has changed'){ ed.save(); update...} function.

deeg commented 8 years ago

@lauraerinmann, after this comment a new version was released to debounce updates.

This should have solved the issue a bit, I suggest updating to see some improvement. Will leave this PR open to see if we can't improve it more.

lauraerinmann commented 8 years ago

@deeg yeah I noticed those changes and I added them to my application. Still the same issue when the amount of the content in the editor is sufficiently large.