From 13ef7eeb63487badc144b15191e4c177c78f9e82 Mon Sep 17 00:00:00 2001 From: Joshua Walsh Date: Wed, 21 Jun 2017 03:25:14 +1000 Subject: [PATCH] Fixed #3183 (#3184) Fixes a race condition that set an item's group to be set to undefined if it was dropped and then dragged again without a redraw happening in between. --- lib/timeline/component/ItemSet.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/timeline/component/ItemSet.js b/lib/timeline/component/ItemSet.js index 0aa845b9..e5e168a3 100644 --- a/lib/timeline/component/ItemSet.js +++ b/lib/timeline/component/ItemSet.js @@ -1342,6 +1342,12 @@ ItemSet.prototype._onDragStart = function (event) { this.touchParams.itemProps = [props]; } else { + if(this.groupIds.length < 1) { + // Mitigates a race condition if _onDragStart() is + // called after markDirty() without redraw() being called between. + this.redraw(); + } + var baseGroupIndex = this._getGroupIndex(item.data.group); var itemsToDrag = (this.options.itemsAlwaysDraggable.item && !item.selected) ? [item.id] : this.getSelection();