forked from elastic/elastic-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tooltip): render tooltip on portal to avoid hidden overflows
The current tooltip was rendered inside the chart container. If the chart is rendered inside a DOM element with an hidden overflow, then the tooltip will be cutted. I moved the tooltip element to render on the document body through a React portal. close elastic#375
- Loading branch information
Showing
20 changed files
with
434 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+18.4 KB
...ns-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-bottom-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.8 KB
...tions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-top-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+18.6 KB
...ons-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-bottom-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+20.1 KB
...ctions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-top-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.4 KB
...s-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-bottom-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.2 KB
...ions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-top-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.6 KB
...ns-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-bottom-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.4 KB
...tions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-top-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { common } from '../page_objects'; | ||
|
||
describe.only('Tooltips', () => { | ||
describe('rotation 0', () => { | ||
it('shows tooltip on first x value - top', async () => { | ||
await common.expectChartWithMouseAtUrlToMatchScreenshot( | ||
'http://localhost:9001/?path=/story/bar-chart--test-tooltip-and-rotation', | ||
{ | ||
x: 160, | ||
y: 25, | ||
}, | ||
); | ||
}); | ||
it('shows tooltip on last x value - top', async () => { | ||
await common.expectChartWithMouseAtUrlToMatchScreenshot( | ||
'http://localhost:9001/?path=/story/bar-chart--test-tooltip-and-rotation', | ||
{ | ||
x: 660, | ||
y: 25, | ||
}, | ||
); | ||
}); | ||
it('shows tooltip on first x value - bottom', async () => { | ||
await common.expectChartWithMouseAtUrlToMatchScreenshot( | ||
'http://localhost:9001/?path=/story/bar-chart--test-tooltip-and-rotation', | ||
{ | ||
x: 160, | ||
y: 280, | ||
}, | ||
); | ||
}); | ||
it('shows tooltip on last x value - bottom', async () => { | ||
await common.expectChartWithMouseAtUrlToMatchScreenshot( | ||
'http://localhost:9001/?path=/story/bar-chart--test-tooltip-and-rotation', | ||
{ | ||
x: 660, | ||
y: 280, | ||
}, | ||
); | ||
}); | ||
}); | ||
describe('rotation 90', () => { | ||
it('shows tooltip on first x value - top', async () => { | ||
await common.expectChartWithMouseAtUrlToMatchScreenshot( | ||
'http://localhost:9001/?path=/story/bar-chart--test-tooltip-and-rotation&knob-chartRotation=90', | ||
{ | ||
x: 125, | ||
y: 50, | ||
}, | ||
); | ||
}); | ||
it('shows tooltip on last x value - top', async () => { | ||
await common.expectChartWithMouseAtUrlToMatchScreenshot( | ||
'http://localhost:9001/?path=/story/bar-chart--test-tooltip-and-rotation&knob-chartRotation=90', | ||
{ | ||
x: 700, | ||
y: 50, | ||
}, | ||
); | ||
}); | ||
it('shows tooltip on first x value - bottom', async () => { | ||
await common.expectChartWithMouseAtUrlToMatchScreenshot( | ||
'http://localhost:9001/?path=/story/bar-chart--test-tooltip-and-rotation&knob-chartRotation=90', | ||
{ | ||
x: 125, | ||
y: 270, | ||
}, | ||
); | ||
}); | ||
it('shows tooltip on last x value - bottom', async () => { | ||
await common.expectChartWithMouseAtUrlToMatchScreenshot( | ||
'http://localhost:9001/?path=/story/bar-chart--test-tooltip-and-rotation&knob-chartRotation=90', | ||
{ | ||
x: 700, | ||
y: 270, | ||
}, | ||
); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.