Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v11.0.x] Dashboards: Removes descending z-index assignment for grid items #85596

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions public/app/features/dashboard/dashgrid/DashboardGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,10 @@ export class DashboardGrid extends PureComponent<Props, State> {
for (const panel of this.props.dashboard.panels) {
const panelClasses = classNames({ 'react-grid-item--fullscreen': panel.isViewing });

// used to allow overflowing content to show on top of the next panel
// requires parent create stacking context to prevent overlap with parent elements
const descIndex = this.props.dashboard.panels.length - panelElements.length;

const p = (
<GrafanaGridItem
key={panel.key}
className={panelClasses}
descendingOrderIndex={descIndex}
data-panelid={panel.id}
gridPos={panel.gridPos}
gridWidth={gridWidth}
Expand Down Expand Up @@ -363,7 +358,6 @@ export class DashboardGrid extends PureComponent<Props, State> {
interface GrafanaGridItemProps extends React.HTMLAttributes<HTMLDivElement> {
gridWidth?: number;
gridPos?: GridPos;
descendingOrderIndex?: number;
isViewing: boolean;
windowHeight: number;
windowWidth: number;
Expand All @@ -378,7 +372,7 @@ const GrafanaGridItem = React.forwardRef<HTMLDivElement, GrafanaGridItemProps>((
let width = 100;
let height = 100;

const { gridWidth, gridPos, isViewing, windowHeight, windowWidth, descendingOrderIndex, ...divProps } = props;
const { gridWidth, gridPos, isViewing, windowHeight, windowWidth, ...divProps } = props;
const style: CSSProperties = props.style ?? {};

if (isViewing) {
Expand Down Expand Up @@ -408,7 +402,7 @@ const GrafanaGridItem = React.forwardRef<HTMLDivElement, GrafanaGridItemProps>((

// props.children[0] is our main children. RGL adds the drag handle at props.children[1]
return (
<div {...divProps} style={{ ...divProps.style, zIndex: descendingOrderIndex }} ref={ref}>
<div {...divProps} style={{ ...divProps.style }} ref={ref}>
{/* Pass width and height to children as render props */}
{[props.children[0](width, height), props.children.slice(1)]}
</div>
Expand Down
Loading