Add check for potential failure in handling drag (#2499)

* add check for potential failure in handling drag

* move check to avoid ui glitches
This commit is contained in:
Anthony Dresser
2018-09-10 21:17:42 -07:00
committed by Karl Burtram
parent ffb0f5a1c7
commit 7735f68502

View File

@@ -128,8 +128,11 @@ export class CellRangeSelector<T> implements ICellRangeSelector<T> {
this.canvas.classList.remove(this.options.dragClass);
this.dragging = false;
e.stopImmediatePropagation();
this.decorator.hide();
// if this happens to fast there is a chance we don't have the necessary information to actually do proper selection
if (!dd || !dd.range || !dd.range.start || !dd.range.end) {
return;
}
this.onCellRangeSelected.notify({
range: new Slick.Range(
dd.range.start.row,