Skip to content

Commit 8112402

Browse files
committed
z-index for modal dialogs
fix #2352 * make sure .ui-draggable-dragging is not just item (dragIn region) and high enough z-index to solve bootstrap modals too
1 parent 66ce655 commit 8112402

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

doc/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Change log
9292

9393
## 8.2.1-dev (TBD)
9494
* fix [#2349](https://github.com/gridstack/gridstack.js/issues/2349) grid NoMove vs item NoMove support
95+
* fix [#2352](https://github.com/gridstack/gridstack.js/issues/2352) .ui-draggable-dragging z-index for modal dialogs
9596

9697
## 8.2.1 (2023-05-26)
9798
* fix: make sure `removeNode()` uses internal _id (unique) and not node itself (since we clone those often)

src/gridstack.scss

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,6 @@ $animation_speed: .3s !default;
103103
}
104104
}
105105

106-
&.ui-draggable-dragging,
107-
&.ui-resizable-resizing {
108-
z-index: 100;
109-
110-
> .grid-stack-item-content {
111-
box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2);
112-
opacity: 0.8;
113-
}
114-
}
115-
116106
&.ui-draggable-dragging {
117107
will-change: left, top;
118108
cursor: move;
@@ -123,6 +113,17 @@ $animation_speed: .3s !default;
123113
}
124114
}
125115

116+
// not .grid-stack-item specific to also affect dragIn regions
117+
.ui-draggable-dragging,
118+
.ui-resizable-resizing {
119+
z-index: 10000; // bootstrap modal has a z-index of 1050
120+
121+
> .grid-stack-item-content {
122+
box-shadow: 1px 4px 6px rgba(0, 0, 0, 0.2);
123+
opacity: 0.8;
124+
}
125+
}
126+
126127
.grid-stack-animate,
127128
.grid-stack-animate .grid-stack-item {
128129
@include vendor(transition, left $animation_speed, top $animation_speed, height $animation_speed, width $animation_speed);

0 commit comments

Comments
 (0)