Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DashboardGrid: Add LayoutItemContext to affect zIndex from panels (#8…
- Loading branch information
Showing
3 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/grafana-ui/src/components/Layout/LayoutItemContext.ts
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,21 @@ | ||
import { createContext } from 'react'; | ||
|
||
export interface LayoutItemContextProps { | ||
boostZIndex(): () => void; | ||
} | ||
|
||
/** | ||
* Provides an API for downstream components (e.g. within panels) to inform the layout | ||
* that anchored tooltips or context menus could overflow the panel bounds. The layout | ||
* system can then boost the z-index of items with any anchored contents to prevent the overflown | ||
* content from rendering underneath adjacent layout items (e.g. other panels) that naturally | ||
* render later/higher in the stacking order | ||
* | ||
* This is used by VizTooltips and Annotations, which anchor to data points or time range within | ||
* the viz drawing area | ||
* | ||
* @internal | ||
*/ | ||
export const LayoutItemContext = createContext<LayoutItemContextProps>({ | ||
boostZIndex: () => () => {}, | ||
}); |
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