diff --git a/HISTORY.md b/HISTORY.md index 79bbf04a..538c7188 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -12,7 +12,9 @@ http://visjs.org - Fixed #1441: Height of subgroups not immediately updated after updating data in a DataSet or DataView. - +- Fixed #1491: Problem using ctrl+drag in combination with using a `DataView`, + and an issue with ctrl+drag when using `snap: null`. + ### Graph2d - Implemented a new option for `shaded.orientation` to always shade towards zero. diff --git a/lib/DataSet.js b/lib/DataSet.js index f4ca42ec..f42ca848 100644 --- a/lib/DataSet.js +++ b/lib/DataSet.js @@ -357,7 +357,7 @@ DataSet.prototype.get = function (args) { if (id != undefined) { // return a single item item = me._getItem(id, type); - if (filter && !filter(item)) { + if (item && filter && !filter(item)) { item = null; } } diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 4ec39bfb..edff2897 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -1248,7 +1248,7 @@ ItemSet.prototype._onDragStartAddItem = function (event) { var time = this.body.util.toTime(x); var scale = this.body.util.getScale(); var step = this.body.util.getStep(); - var start = snap ? snap(time, scale, step) : start; + var start = snap ? snap(time, scale, step) : time; var end = start; var itemData = {