diff --git a/HISTORY.md b/HISTORY.md index 538c7188..e5f83ef8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -21,6 +21,9 @@ http://visjs.org Thanks @ludost. - Fixed support for using a `DataView` in Graph2d. Thanks @ludost. +### DataSet +- Fixed #1487: DataSet cannot remove an item with id `0` correctly. + ## 2015-11-27, version 4.10.0 diff --git a/lib/DataSet.js b/lib/DataSet.js index f42ca848..75cb316d 100644 --- a/lib/DataSet.js +++ b/lib/DataSet.js @@ -704,7 +704,7 @@ DataSet.prototype._remove = function (id) { } else if (id instanceof Object) { var itemId = id[this._fieldId]; - if (itemId && this._data[itemId]) { + if (itemId !== undefined && this._data[itemId]) { delete this._data[itemId]; this.length--; return itemId;