Fix Unwanted Highlight in ManagedTable

Summary: Previously, rows got highlighted after switching between data for `ManagedTable` even though `highlightableRows` was set to false. This diff forces the highlighting not to happen when the value is set to false

Reviewed By: mweststrate

Differential Revision: D21720266

fbshipit-source-id: 534944fe03ad1561bc2109468ae6c4c5f3fc947d
This commit is contained in:
Chaiwat Ekkaewnumchai
2020-05-26 05:48:03 -07:00
committed by Facebook GitHub Bot
parent 2283bbd313
commit dec5045fca

View File

@@ -402,6 +402,10 @@ export class ManagedTable extends React.Component<
}
onHighlight = (e: React.MouseEvent, row: TableBodyRow, index: number) => {
if (!this.props.highlightableRows) {
return;
}
if (e.shiftKey) {
// prevents text selection
e.preventDefault();