Skip to content

Commit 80a7d75

Browse files
authored
fix: prevent incorrect overflow in Safari (#180) (#181)
1 parent 5ec3e11 commit 80a7d75

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

src/vaadin-dialog-resizable-mixin.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
}
2020

2121
[part='overlay'][style] .resizer-container {
22-
height: 100%;
22+
min-height: 100%;
2323
width: 100%;
2424
}
2525

test/vaadin-dialog_draggable-resizable-test.html

+29
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@
7979
</template>
8080
</test-fixture>
8181

82+
<test-fixture id="overflow">
83+
<template>
84+
<vaadin-dialog draggable opened modeless>
85+
<template>
86+
</template>
87+
</vaadin-dialog>
88+
</template>
89+
</test-fixture>
90+
8291
<script>
8392
function dispatchMouseEvent(target, type, coords = {x: 0, y: 0}, button = 0) {
8493
const e = new MouseEvent(type, {
@@ -728,5 +737,25 @@
728737
expect(modalDialog.opened).to.be.true;
729738
});
730739
});
740+
741+
describe('dialog with overflowing content', () => {
742+
let dialog;
743+
744+
beforeEach(() => {
745+
dialog = fixture('overflow');
746+
});
747+
748+
it('should not overflow when style attribute is set on the overlay part', () => {
749+
const container = document.createElement('div');
750+
container.style.maxWidth = '300px';
751+
container.style.overflow = 'auto';
752+
container.textContent = Array(100).join('Lorem ipsum dolor sit amet');
753+
const overlay = dialog.$.overlay;
754+
overlay.content.appendChild(container);
755+
// emulate removing "pointer-events: none"
756+
overlay.$.overlay.setAttribute('style', '');
757+
expect(overlay.$.overlay.offsetHeight).to.equal(overlay.$.resizerContainer.offsetHeight);
758+
});
759+
});
731760
</script>
732761
</body>

0 commit comments

Comments
 (0)