From 7735f685028d8ff78afd2ae56ff40440ee84bfb1 Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Mon, 10 Sep 2018 21:17:42 -0700 Subject: [PATCH] Add check for potential failure in handling drag (#2499) * add check for potential failure in handling drag * move check to avoid ui glitches --- src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts b/src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts index b3ef8783ef..e76d44c146 100644 --- a/src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts +++ b/src/sql/base/browser/ui/table/plugins/cellRangeSelector.ts @@ -128,8 +128,11 @@ export class CellRangeSelector implements ICellRangeSelector { 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,