ZSSRichTextEditor
ZSSRichTextEditor copied to clipboard
receiveEditorDidChangeEvents causes massive delay
I've enabled receiveEditorDidChangeEvents = YES so that I get a change event for the text to be able to be able to use a "dirty" flag for the text. Works fine if you don't add any image. But adding an image from the photo roll makes this so slow that after entering a single new character the device hangs for a second or so. (on iOS 10, iPhone 6).
Any idea how to solve this?
Thanks Martin
@MartinSchultz looks like we need to filter what gets passed when change events happen as images shouldn't need to be passed, if you get this solved then feel free to submit a pull request, if not then I will get working on a fix for this asap.
I haven't solved it, would love to see a fix from you. 👍
any update on this issue? @william205
I solved the problem of extreme delay by eliminating the call to -tidyHTML
in -getHTML
:
- (void)getHTML:(void (^ _Nullable)(_Nullable id, NSError * _Nullable error))completionHandler {
[self.editorView evaluateJavaScript:ZSSEditorHTML completionHandler:^(NSString *result, NSError *error) {
if (error != NULL) {
NSLog(@"HTML Parsing Error: %@", error);
}
NSString *html = [self removeQuotesFromHTML:result];
// [self tidyHTML:html completionHandler:^(NSString *result, NSError *error) {
// completionHandler(result, error);
// }];
completionHandler(result, error);
}];
}