Skip to content

Commit 584544e

Browse files
authored
Fix Jetpack Forms dashboard height hack (#44391)
* remove height 100% on ancesters of wpadmin layout, use min-height instead. Add optional fixed footer * fix response area margin bottom to match the fixed footer height
1 parent e4190cd commit 584544e

File tree

3 files changed

+43
-20
lines changed

3 files changed

+43
-20
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: changed
3+
4+
Remove all height hacks, attend to some style issues and fix the footer to the bottom. Works on mobile.

projects/packages/forms/src/dashboard/components/layout/style.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ body.jetpack_page_jetpack-forms-admin {
2121
margin: 0;
2222
padding: 0;
2323
width: 100%;
24-
height: 100%;
24+
min-height: calc(100vh - 32px); // 32px is the height of the top admin bar
2525

2626
.jp-forms__logo-wrapper,
2727
.jp-forms__layout-header {
@@ -66,7 +66,7 @@ body.jetpack_page_jetpack-forms-admin {
6666
.jp-forms__dashboard-tabs {
6767
display: flex;
6868
flex-direction: column;
69-
flex-grow: 1;
69+
flex: 1;
7070

7171
> .components-tab-panel__tabs {
7272
margin: 0;
@@ -99,8 +99,14 @@ body.jetpack_page_jetpack-forms-admin {
9999
}
100100
}
101101

102+
.jp-forms__inbox__dataviews__container {
103+
justify-content: unset;
104+
align-items: unset;
105+
}
106+
102107
.components-tab-panel__tab-content {
103-
height: 100%;
108+
display: flex;
109+
flex: 1;
104110
}
105111
}
106112
}

projects/packages/forms/src/dashboard/inbox/style.scss

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -304,24 +304,19 @@ $action-bar-height: 88px;
304304
}
305305

306306
.jp-forms__inbox__dataviews__container {
307-
height: 100%;
308307
box-sizing: border-box;
309-
min-height: 400px;
308+
justify-content: unset;
309+
align-items: unset;
310310
}
311311

312312
.jp-forms__inbox__dataviews {
313313
display: flex;
314314
flex-direction: column;
315-
height: 100%;
316-
max-height: 100%;
317315
flex: 1 1 60%;
318316

319317
.dataviews-wrapper {
320318
background: var(--jp-white);
321-
height: 300px;
322319
flex-grow: 1;
323-
overflow-y: visible;
324-
overflow-x: auto;
325320

326321
@media (min-width: 782px) {
327322
border-right: 1px solid var(--jp-gray-5);
@@ -350,13 +345,38 @@ $action-bar-height: 88px;
350345
}
351346
}
352347
}
348+
349+
// optionally, fix the footer to bottom of the page and add margin so the last row is not hidden by the footer
350+
margin-bottom: 97px;
351+
352+
@media (min-width: 782px) {
353+
margin-bottom: 57px;
354+
}
355+
356+
.dataviews-footer {
357+
position: fixed;
358+
bottom: 0;
359+
width: 100%;
360+
left: 0;
361+
362+
@media (min-width: 782px) {
363+
width: calc(100% - 160px);
364+
left: 160px; // 160px is compensation for the width of the sidebar
365+
}
366+
}
353367
}
354368

355369
.jp-forms__inbox__dataviews-response {
356370
min-width: 300px !important;
357-
height: 100%;
358371
overflow: auto;
359372
flex: 1 1 40%;
373+
374+
// Same as the margin-bottom on the .jp-forms__inbox__dataviews
375+
margin-bottom: 97px;
376+
377+
@media (min-width: 782px) {
378+
margin-bottom: 57px;
379+
}
360380
}
361381

362382

@@ -368,25 +388,18 @@ body.jetpack_page_jetpack-forms-admin {
368388
#wpcontent,
369389
#wpbody,
370390
#wpbody-content {
371-
height: 100%;
391+
min-height: 100%;
372392
}
373393
}
374394

375395
#jp-forms-dashboard {
376-
height: 100%;
377396
display: flex;
378397
flex-direction: column;
379398
width: 100%;
380-
381-
// This is the ThemeWrapper div, we need to keep it at 100% for the inner content to be full height.
382-
> div:first-child {
383-
height: 100%;
384-
}
385-
386399
}
387400

388401
.jp-forms__inbox-tabs .components-tab-panel__tab-content {
389-
flex: 1 1 auto;
402+
flex: 1;
390403

391404
/* Important to pair with flex-shrink */
392405
min-height: 0;;

0 commit comments

Comments
 (0)