fixed trailing space bug in contenteditable elements

This commit is contained in:
Kevin Jahns 2015-07-17 10:43:39 +02:00
parent a4f7f5c987
commit 4563ccc98e
2 changed files with 4 additions and 1 deletions

View File

@ -52,6 +52,9 @@
this.eventHandler.callUserEventListeners(userEvents);
});
}
get length () {
return this.idArray.length;
}
get (pos) {
if (pos == null || typeof pos !== "number") {
throw new Error("pos must be a number!");

View File

@ -160,7 +160,7 @@
return true;
} else if (char.length > 0) {
var r = createRange();
var pos = Math.min(r.left, r.right);
var pos = Math.min(r.left, r.right, word.length);
var diff = Math.abs(r.right - r.left);
word.delete(pos, diff);
word.insert(pos, char);