Skip to content

Commit

Permalink
Move tooltips to position fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
gregtatum committed Jun 8, 2017
1 parent 88c0fd9 commit 287d0de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 0 additions & 2 deletions res/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ body {
}

#root {
/* Create a stacking context so that tooltips can be placed over the root element. */
position: relative;
z-index: 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/content/components/TimelineCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Props<HoveredItem> = {
isDragging: boolean,
getHoveredItemInfo: HoveredItem => React$Element<*>,
drawCanvas: (CanvasRenderingContext2D, HoveredItem | null) => void,
onDoubleClickItem: HoveredItem => void,
onDoubleClickItem: (HoveredItem | null) => void,
hitTest: (x: CssPixels, y: CssPixels) => HoveredItem | null,
};

Expand Down
12 changes: 3 additions & 9 deletions src/content/components/Tooltip.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
.tooltipMount {
/* Create a stacking context above the root container element. */
position: absolute;
z-index: 1;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
pointer-events: none;
/* Stack the tooltip mounting point above the root element. */
z-index: 1;
}

.tooltip {
position: relative;
position: fixed;
max-width: 100%;
box-sizing: border-box;
display: inline-block;
Expand Down

0 comments on commit 287d0de

Please sign in to comment.