| Project: | Wysiwyg cleaner |
| Version: | 6.x-1.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Issue Summary
If the cleaner is enabled the editor looses focus after every keystroke, this only happens in Chrome. I looked into the code and found out the reason is the following:
$(iframeDocument).bind('input paste',function(e) {
// After timeout, paste is effective
window.setTimeout(function() {
var contentAfterPaste = editor._process(body.html(), settings);
body.html(contentAfterPaste);
}, 0);
});
If the function is only bound to 'paste' it start working again. I'm sure the 'input' part is there for a reason but I haven't found it yet?
After I changed the code to the following it seems to work in all major browsers:
$(iframeDocument).bind('paste',function(e) {
// After timeout, paste is effective
window.setTimeout(function() {
var contentAfterPaste = editor._process(body.html(), settings);
body.html(contentAfterPaste);
}, 0);
});
Comments
#1
I experienced this problem as well and am trying the above workaround, but I'd like to know if this is going to break anything else.
#2
Same problem here, also in latest dev version. I tried your solution and it works. Didnt found any problems yet. Please provide it as a patch. Thanx
#3
here is the patch reflecting markwittens changes
#4
@markwittens and @boreg : Thanks, I can't see any reason why I did this. I'll commit this soon.