Skip to content

Commit 5348f6f

Browse files
authored
refactor!: remove z-index update logic from bringToFront method (#9847)
1 parent 4235e39 commit 5348f6f

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

packages/overlay/src/vaadin-overlay-stack-mixin.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,6 @@ export const OverlayStackMixin = (superClass) =>
8181
* Brings the overlay as visually the frontmost one.
8282
*/
8383
bringToFront() {
84-
// Update z-index to be the highest among all attached overlays
85-
// TODO: Can be removed after switching all overlays to be based on native popover
86-
let zIndex = '';
87-
const frontmost = getAttachedInstances()
88-
.filter((o) => o !== this)
89-
.pop();
90-
if (frontmost) {
91-
const frontmostZIndex = parseFloat(getComputedStyle(frontmost).zIndex);
92-
zIndex = frontmostZIndex + 1;
93-
}
94-
this.style.zIndex = zIndex;
95-
9684
// If the overlay is the last one, or if all other overlays shown above
9785
// are nested overlays (e.g. date-picker inside a dialog), do not call
9886
// `showPopover()` unnecessarily to avoid scroll position being reset.

packages/overlay/test/multiple.test.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,6 @@ describe('multiple overlays', () => {
228228
expect(overlay.scrollTop).to.equal(100);
229229
});
230230

231-
it('should grow the z-index by 1', () => {
232-
modeless1.opened = true;
233-
modeless2.opened = true;
234-
modeless1.bringToFront();
235-
236-
const zIndex1 = parseFloat(getComputedStyle(modeless1).zIndex);
237-
const zIndex2 = parseFloat(getComputedStyle(modeless2).zIndex);
238-
expect(zIndex1).to.equal(zIndex2 + 1);
239-
});
240-
241231
it('should bring the newly opened overlay to front', () => {
242232
modeless1.opened = true;
243233
modeless2.opened = true;
@@ -250,20 +240,6 @@ describe('multiple overlays', () => {
250240
expect(frontmost).to.equal(modeless2);
251241
});
252242

253-
it('should reset z-indexes', () => {
254-
modeless1.opened = true;
255-
modeless2.opened = true;
256-
257-
const zIndex1 = parseFloat(getComputedStyle(modeless1).zIndex);
258-
expect(parseFloat(modeless2.style.zIndex)).to.equal(zIndex1 + 1);
259-
260-
modeless1.opened = false;
261-
modeless2.opened = false;
262-
263-
modeless2.opened = true;
264-
expect(modeless2.style.zIndex).to.be.empty;
265-
});
266-
267243
it('should not call showPopover on bringToFront if only nested overlay is open', () => {
268244
modeless2.opened = true;
269245
modeless2.opened = true;

0 commit comments

Comments
 (0)