diff --git a/docs/timeline.html b/docs/timeline.html index ee22e962..74445571 100644 --- a/docs/timeline.html +++ b/docs/timeline.html @@ -820,6 +820,7 @@ timeline.off('select', onSelect); select Fired after the user selects or deselects items by tapping or holding them. + When a use taps an already selected item, the select event is fired again. Not fired when the method setSelectionis executed. diff --git a/src/timeline/Timeline.js b/src/timeline/Timeline.js index a5738870..961484dd 100644 --- a/src/timeline/Timeline.js +++ b/src/timeline/Timeline.js @@ -633,8 +633,9 @@ Timeline.prototype._onSelectItem = function (event) { var newSelection = this.getSelection(); - // if selection is changed, emit a select event - if (!util.equalArray(oldSelection, newSelection)) { + // emit a select event, + // except when old selection is empty and new selection is still empty + if (newSelection.length > 0 || oldSelection.length > 0) { this.emit('select', { items: this.getSelection() });