Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Range selection does not work on first try #787

Open
frykten opened this issue Nov 20, 2019 · 0 comments
Open

Range selection does not work on first try #787

frykten opened this issue Nov 20, 2019 · 0 comments

Comments

@frykten
Copy link
Contributor

frykten commented Nov 20, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant