(cherry picked from commit
e32eab0)
if(mutation.target.data === '') {
mutation.target.data = utils.unicode.ZWS;
}
if(mutation.target.data === '') {
mutation.target.data = utils.unicode.ZWS;
}
- else if(mutation.oldValue === utils.unicode.ZWS) {
+ if(mutation.target.data === mutation.oldValue) {
+ return; // shouldn't happen, but better be safe
+ }
+ if(mutation.oldValue === utils.unicode.ZWS) {
mutation.target.data = mutation.target.data.replace(utils.unicode.ZWS, '');
canvas._moveCaretToTextElement(canvas.getDocumentElement(mutation.target), 'end');
}
mutation.target.data = mutation.target.data.replace(utils.unicode.ZWS, '');
canvas._moveCaretToTextElement(canvas.getDocumentElement(mutation.target), 'end');
}
if(text === '') {
text = utils.unicode.ZWS;
}
if(text === '') {
text = utils.unicode.ZWS;
}
- if(text !== this.getText()) {
+ if(text !== this.dom.contents()[0].data) {
this.dom.contents()[0].data = text;
}
},
this.dom.contents()[0].data = text;
}
},
element = s.canvas.getNearestTextElement('below', s.element);
}
element = s.canvas.getNearestTextElement('below', s.element);
}
var parent = element.wlxmlNode.parent();
if(element.wlxmlNode.getIndex() === 0 && parent.isContextRoot() && (!parent.is('item') || parent.getIndex() === 0)) {
// Don't even try to do anything at the edge of a context root, except for non-first items
var parent = element.wlxmlNode.parent();
if(element.wlxmlNode.getIndex() === 0 && parent.isContextRoot() && (!parent.is('item') || parent.getIndex() === 0)) {
// Don't even try to do anything at the edge of a context root, except for non-first items
s.canvas.wlxmlDocument.transaction(function() {
if(element.wlxmlNode.getIndex() === 0) {
goto = element.wlxmlNode.parent().moveUp();
s.canvas.wlxmlDocument.transaction(function() {
if(element.wlxmlNode.getIndex() === 0) {
goto = element.wlxmlNode.parent().moveUp();