fix range select

Summary:
Where was a bug, where a range selection using the shift key wasn't working, when the start of the selection was outside the viewport.
The problem was caused by `selectInRange` firing twice, the second time with wrong arguments. In this diff, we are not firing the `onMouseEnterRow` handler, when the shift key is pressed.

Reviewed By: jknoxville

Differential Revision: D15897880

fbshipit-source-id: 95402dcbe9f8ce691be16cfd103918b09ff9e75c
This commit is contained in:
Daniel Büchele
2019-06-19 06:20:25 -07:00
committed by Facebook Github Bot
parent d6bb5e5d32
commit 3f1ab6be47

View File

@@ -478,7 +478,8 @@ class ManagedTable extends React.Component<
dragStartIndex && dragStartIndex &&
current && current &&
this.props.multiHighlight && this.props.multiHighlight &&
this.props.highlightableRows this.props.highlightableRows &&
!e.shiftKey // When shift key is pressed, it's a range select not a drag select
) { ) {
current.scrollToItem(index + 1); current.scrollToItem(index + 1);
const startKey = this.props.rows[dragStartIndex].key; const startKey = this.props.rows[dragStartIndex].key;