Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE11, deleting all WYSIHTML content leads to dropping WYSIHTML DOM Element #371

Open
starlocke opened this issue Jan 24, 2017 · 1 comment

Comments

@starlocke
Copy link

I'm using some version 0.5.5 of WYSIHTML.

I haven't fully pinpointed the root cause yet, but in IE11 (not Edge, haven't tested older versions), the WYSIHTML DOM Element for editing can be dropped (read: deleted) when a user presses on DELETE to delete all the content and then the keyboard repeat or another "make sure to get it done" DELETE key press event happens.

Something along the lines of: WYSIHTML content becomes empty, focus shifts elsewhere, IE11 position's the "cursor" atop the WYSIHTML DOM element in some sense, the next DELETE action will delete it.

Has anyone else experienced this?

If it can't be reproduced with vanilla WYSIHTML, then, I'll suppose one of the special "add-on" input adjustment methods I've created is introducing the bug.

@torkjels
Copy link

torkjels commented Feb 7, 2017

I just experienced this myself. Version 0.6.0-beta1, so I guess it's a problem spanning multiple releases.
Whenever the content of the editor is empty in IE11 and you click backspace, the entire editor gets removed.
The toolbar remains, but not the input field.

For whatever it's wroth, I'm using wysihtml on a div, not a textarea.

UPDATE: @pulges
The line to blame is
if (removeOldWrapper) { node.parentNode.removeChild(node); }
in the function transferContentTo: function(targetNode, removeOldWrapper) that's called from fixDeleteInTheBeginningOfControlSelection on line 282 of composer.observe.js.

All of this happens as a result of handleDeleteKeyPress being called when you click Backspace. I don't have time to look more into it just now, but I assume it's not as easy as just removing that line, as that might mess something else up.

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

No branches or pull requests

2 participants