mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
Clear phantoms on teardown in ProtectedNode
When you typed after a ProtectedNode that was previously at the end of a paragraph, then moved the mouse, you'd get a JS error. What happened was the typing caused a new TextNode to be created after the ProtectedNode, which caused the ParagraphNode to be rebuilt, detaching the original ProtectedNode and creating a new one. The detached ProtectedNode was still bound to mousemove on the body, and when that event fired it would try to remove its phantoms from the surface and fail because detached nodes can't get to the surface. Change-Id: I9f38776f0267645b14d7b26e2a25007cf3be8ec7
This commit is contained in:
parent
6ddf7f3695
commit
e6c7aa4275
|
@ -105,6 +105,9 @@ ve.ce.ProtectedNode.prototype.onProtectedTeardown = function () {
|
|||
// Shields
|
||||
this.$shields.remove();
|
||||
this.$shields = $( [] );
|
||||
|
||||
// Phantoms
|
||||
this.clearPhantoms();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue