diff --git a/components/dash-table/src/dash-table/derived/table/tooltip.ts b/components/dash-table/src/dash-table/derived/table/tooltip.ts index 54620dea99..f2651df322 100644 --- a/components/dash-table/src/dash-table/derived/table/tooltip.ts +++ b/components/dash-table/src/dash-table/derived/table/tooltip.ts @@ -42,7 +42,7 @@ function getSelectedTooltip( return ( !tt.if || (ifColumnId(tt.if, id) && - ifRowIndex(tt.if, row) && + ifRowIndex(tt.if, virtualized.indices[row - virtualized.offset.rows]) && ifFilter( tt.if, virtualized.data[row - virtualized.offset.rows] diff --git a/components/dash-table/src/dash-table/handlers/cellEvents.ts b/components/dash-table/src/dash-table/handlers/cellEvents.ts index 8ece59511e..6fc6d02dfa 100644 --- a/components/dash-table/src/dash-table/handlers/cellEvents.ts +++ b/components/dash-table/src/dash-table/handlers/cellEvents.ts @@ -160,13 +160,13 @@ export const handleEnter = ( idx: number, i: number ) => { - const {setState, virtualized, visibleColumns} = propsFn(); + const {setState, visibleColumns} = propsFn(); setState({ currentTooltip: { header: false, id: visibleColumns[i].id, - row: virtualized.indices[idx - virtualized.offset.rows] + row: idx } }); }; @@ -202,15 +202,14 @@ export const handleMove = ( idx: number, i: number ) => { - const {currentTooltip, setState, virtualized, visibleColumns} = propsFn(); + const {currentTooltip, setState, visibleColumns} = propsFn(); const c = visibleColumns[i]; - const realIdx = virtualized.indices[idx - virtualized.offset.rows]; if ( currentTooltip && currentTooltip.id === c.id && - currentTooltip.row === realIdx && + currentTooltip.row === idx && !currentTooltip.header ) { return; @@ -220,7 +219,7 @@ export const handleMove = ( currentTooltip: { header: false, id: c.id, - row: realIdx + row: idx } }); };