Skip to content

Commit 9af9299

Browse files
jounivursen
andauthored
fix: dialog base styles max-width (#10285)
* fix: dialog base styles max-width * fix unit tests --------- Co-authored-by: Sergey Vinogradov <mr.vursen@gmail.com>
1 parent abd9bd4 commit 9af9299

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/dialog/src/styles/vaadin-dialog-overlay-base-styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const dialogOverlayBase = css`
3737
border-radius: var(--vaadin-dialog-border-radius, var(--vaadin-radius-l));
3838
width: max-content;
3939
min-width: min(var(--vaadin-dialog-min-width, 4em), 100%);
40-
max-width: var(--vaadin-dialog-max-width, 100%);
40+
max-width: min(var(--vaadin-dialog-max-width, 100%), 100%);
4141
max-height: 100%;
4242
}
4343

packages/dialog/test/dialog.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ describe('vaadin-dialog', () => {
354354
dialog.height = 400;
355355
await nextRender();
356356
expect(getComputedStyle(overlay.$.overlay).position).to.equal('relative');
357-
expect(getComputedStyle(overlay.$.overlay).maxWidth).to.equal('100%');
357+
expect(getComputedStyle(overlay.$.overlay).maxWidth).to.be.oneOf(['100%', 'min(100%, 100%)']);
358358
});
359359

360360
it('should reset overlay width when set to null', async () => {

packages/dialog/test/draggable-resizable.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ describe('draggable', () => {
628628
it('should not set overlay max-width to none on drag', async () => {
629629
drag(container);
630630
await nextRender();
631-
expect(getComputedStyle(dialog.$.overlay.$.overlay).maxWidth).to.equal('100%');
631+
expect(getComputedStyle(dialog.$.overlay.$.overlay).maxWidth).to.be.oneOf(['100%', 'min(100%, 100%)']);
632632
});
633633
});
634634

0 commit comments

Comments
 (0)