diff --git a/HISTORY.md b/HISTORY.md index e0b686a0..7456d461 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -15,6 +15,7 @@ http://visjs.org ### Timeline - Fixed #1001: First element of group style being cut. +- Fixed #1071: HTML contents of a group not cleared when the contents is updated. ## 2015-07-03, version 4.4.0 diff --git a/lib/timeline/component/Group.js b/lib/timeline/component/Group.js index d10c3ba2..e286ff9f 100644 --- a/lib/timeline/component/Group.js +++ b/lib/timeline/component/Group.js @@ -83,6 +83,9 @@ Group.prototype.setData = function(data) { // update contents var content = data && data.content; if (content instanceof Element) { + while (this.dom.inner.firstChild) { + this.dom.inner.removeChild(this.dom.inner.firstChild); + } this.dom.inner.appendChild(content); } else if (content !== undefined && content !== null) {