Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(781)

Unified Diff: ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html

Issue 2843333002: WebUI: restrict cr-dialogs max-height to the viewport. (Closed)
Patch Set: fix test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/webui/cr_elements/cr_dialog_test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html
diff --git a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html
index ca71e580f7eb0f2c1bc4cc1a0c89bf9393095c99..9e3018244f586dcdeadbcfa0e21a7509ddd46bcf 100644
--- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html
+++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html
@@ -20,6 +20,20 @@
width: 512px;
}
+ :host([open]) {
+ /* Keep max-height within viewport, and flex content accordingly. */
+ display: flex;
+ flex-direction: column;
+ max-height: 100vh;
+ }
+
+ /* When needing to flex, force .body-container alone to shrink. */
+ .top-container,
+ :host ::content .button-container,
+ :host ::content .footer {
+ flex-shrink: 0;
+ }
+
:host::backdrop {
background-color: rgba(0, 0, 0, 0.6);
bottom: 0;
@@ -79,6 +93,7 @@
.body-container {
display: flex;
flex-direction: column;
+ min-height: 60px; /* Minimum reasonably usable height. */
overflow: auto;
@apply(--cr-dialog-body-container);
}
« no previous file with comments | « chrome/test/data/webui/cr_elements/cr_dialog_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698