Reset hoverTime on mouse leave instead of mouse out

pull/10616/head
ebb-tide 2018-03-26 09:03:14 -07:00
parent da8d8804e1
commit 0d628bfdab
1 changed files with 4 additions and 4 deletions

View File

@ -59,8 +59,8 @@ class TableGraph extends Component {
super(props) super(props)
this.state = { this.state = {
data: [[]], data: [[]],
timeColumnWidth: calculateTimeColumnWidth(props.tableOptions.timeFormat),
processedData: [[]], processedData: [[]],
timeColumnWidth: calculateTimeColumnWidth(props.tableOptions.timeFormat),
hoveredColumnIndex: NULL_ARRAY_INDEX, hoveredColumnIndex: NULL_ARRAY_INDEX,
hoveredRowIndex: NULL_ARRAY_INDEX, hoveredRowIndex: NULL_ARRAY_INDEX,
sortField: '', sortField: '',
@ -139,7 +139,7 @@ class TableGraph extends Component {
handleHover = (columnIndex, rowIndex) => () => { handleHover = (columnIndex, rowIndex) => () => {
const {onSetHoverTime, tableOptions: {verticalTimeAxis}} = this.props const {onSetHoverTime, tableOptions: {verticalTimeAxis}} = this.props
const {data} = this.state const {data} = this.state
if (rowIndex === 0 && verticalTimeAxis) { if (verticalTimeAxis && rowIndex === 0) {
return return
} }
if (onSetHoverTime) { if (onSetHoverTime) {
@ -154,7 +154,7 @@ class TableGraph extends Component {
}) })
} }
handleMouseOut = () => { handleMouseLeave = () => {
if (this.props.onSetHoverTime) { if (this.props.onSetHoverTime) {
this.props.onSetHoverTime(NULL_HOVER_TIME) this.props.onSetHoverTime(NULL_HOVER_TIME)
this.setState({ this.setState({
@ -344,7 +344,7 @@ class TableGraph extends Component {
<div <div
className="table-graph-container" className="table-graph-container"
ref={gridContainer => (this.gridContainer = gridContainer)} ref={gridContainer => (this.gridContainer = gridContainer)}
onMouseOut={this.handleMouseOut} onMouseLeave={this.handleMouseLeave}
> >
{rowCount > 0 && ( {rowCount > 0 && (
<ColumnSizer <ColumnSizer