Issue 365 - Fix tooltip position & display with fixed columns/rows#366
Issue 365 - Fix tooltip position & display with fixed columns/rows#366Marc-Andre-Rivet merged 10 commits intomasterfrom
Conversation
- Update build for release
| "@types/ramda": "^0.25.47", | ||
| "@types/react": "^16.7.22", | ||
| "@types/react-dom": "^16.0.11", | ||
| "@types/ramda": "^0.25.48", |
There was a problem hiding this comment.
These got updated by renovate but not the py packaged version
| <div className={containerClasses.join(' ')} style={tableStyle}> | ||
| <div className={classes.join(' ')} style={tableStyle}> | ||
| <div | ||
| ref='table' |
There was a problem hiding this comment.
New ref to query all table cells, whether fixed or not.
| const cellBounds = table[0].getBoundingClientRect(); | ||
|
|
||
| expect(bounds.top).to.be.greaterThan(cellBounds.top + cellBounds.height); | ||
| }); |
There was a problem hiding this comment.
This test is a bit crude and tests that the tooltip is placed below the cell. If the adjustment is not run the tooltip is in its default position and will be above the cell (top=0, left=0).
Fail run (w/o fix): https://circleci.com/gh/plotly/dash-table/5051
Successful run (w/ fix): https://circleci.com/gh/plotly/dash-table/5061
| const row = tooltip.row - virtualized.offset.rows; | ||
|
|
||
| const { r1c1, tooltip: t } = this.refs as { [key: string]: any }; | ||
| const { table, tooltip: t } = this.refs as { [key: string]: any }; |
There was a problem hiding this comment.
We want to query the whole table, not just the lower right fragment (which is the same as checking the whole table when nothing is fixed)
| expect(bounds.top).to.be.greaterThan(cellBounds.top + cellBounds.height); | ||
| }); | ||
| }); | ||
| cy.wait(5000); |
There was a problem hiding this comment.
oof, do we really need to wait 5 seconds and test disappearance in all of these cases?
alexcjohnson
left a comment
There was a problem hiding this comment.
Nice fix @Marc-Andre-Rivet 💃
Just one non-blocking comment hoping to keep our total test time under control 😅
Fixes #365
When the table has fixed columns/rows, the data cell can be located elsewhere than in the
r1c1portion of the table. This fix checks for the cell everywhere in the table instead.This didn't prevent the tooltip from being is displayed for fixed cells, it only prevented adjusting its position.