ember-table icon indicating copy to clipboard operation
ember-table copied to clipboard

Range selection does not work on first try

Open frykten opened this issue 6 years ago • 0 comments

Hello!

When using the ranged selection (shift key pressed), on the first try, nothing is selected.

When looking at the code, the culprit is quite obvious:

if (range) {
      // Use a set to avoid item duplication
      let { _lastSelectedIndex } = tree;

      let minIndex = Math.min(_lastSelectedIndex, rowIndex);
      let maxIndex = Math.max(_lastSelectedIndex, rowIndex);

Of course, _lastSelectedIndex is undefined therefore Math.min/max is NaN.

frykten avatar Nov 20 '19 10:11 frykten