Skip to content

Commit

Permalink
fix: do not wrap header content, wrap long title (#4310) (#4325)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Aug 9, 2022
1 parent 3269389 commit b49c3bb
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/dialog/src/vaadin-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,21 @@ registerStyles(
z-index: 1;
}
[part='header'] {
flex-wrap: nowrap;
}
::slotted([slot='header-content']),
::slotted([slot='title']),
::slotted([slot='footer']) {
display: contents;
pointer-events: auto;
}
::slotted([slot='title']) {
overflow-wrap: anywhere;
}
[part='header-content'] {
flex: 1;
}
Expand Down
14 changes: 14 additions & 0 deletions packages/dialog/test/visual/lumo/dialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,18 @@ describe('dialog', () => {
element.footerRenderer = createRenderer('Footer');
await visualDiff(div, 'header-footer-renderer');
});

it('long title and header renderer', async () => {
element.$.overlay.style.maxWidth = '20rem';
element.headerTitle = 'Long title that wraps in multiple lines';
element.headerRenderer = createRenderer('Header');
await visualDiff(div, 'header-title-multiple-lines');
});

it('long single word title and header renderer', async () => {
element.$.overlay.style.maxWidth = '20rem';
element.headerTitle = 'InternationalizationConfigurationHelper';
element.headerRenderer = createRenderer('Header');
await visualDiff(div, 'header-title-long-single-word');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions packages/dialog/test/visual/material/dialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,18 @@ describe('dialog', () => {
element.footerRenderer = createRenderer('Footer');
await visualDiff(div, 'header-footer-renderer');
});

it('long title and header renderer', async () => {
element.$.overlay.style.maxWidth = '20rem';
element.headerTitle = 'Long title that wraps in multiple lines';
element.headerRenderer = createRenderer('Header');
await visualDiff(div, 'header-title-multiple-lines');
});

it('long single word title and header renderer', async () => {
element.$.overlay.style.maxWidth = '20rem';
element.headerTitle = 'InternationalizationConfigurationHelper';
element.headerRenderer = createRenderer('Header');
await visualDiff(div, 'header-title-long-single-word');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b49c3bb

Please sign in to comment.