Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit c94a4ab

Browse files
authored
Merge pull request #9873 from matrix-org/johannes/polls-dialog-scaling
Make create poll dialog scale better (PSG-929)
2 parents 4627456 + 5dfde12 commit c94a4ab

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

res/css/views/dialogs/_CompoundDialog.pcss

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ limitations under the License.
2727
}
2828

2929
.mx_CompoundDialog {
30+
.mx_Dialog {
31+
display: flex;
32+
flex-direction: column;
33+
}
34+
3035
.mx_CompoundDialog_header {
3136
padding: 32px 32px 16px 32px;
3237

@@ -49,6 +54,13 @@ limitations under the License.
4954
}
5055
}
5156

57+
.mx_CompoundDialog_form {
58+
display: flex;
59+
flex-direction: column;
60+
min-height: 0;
61+
max-height: 100%;
62+
}
63+
5264
.mx_CompoundDialog_content {
5365
overflow: auto;
5466
padding: 8px 32px;
@@ -57,10 +69,6 @@ limitations under the License.
5769
.mx_CompoundDialog_footer {
5870
padding: 20px 32px;
5971
text-align: right;
60-
position: absolute;
61-
bottom: 0;
62-
left: 0;
63-
right: 0;
6472

6573
.mx_AccessibleButton {
6674
margin-left: 24px;
@@ -69,14 +77,17 @@ limitations under the License.
6977
}
7078

7179
.mx_ScrollableBaseDialog {
80+
display: flex;
81+
flex-direction: column;
82+
7283
width: 544px; /* fixed */
7384
height: 516px; /* fixed */
74-
75-
.mx_CompoundDialog_content {
76-
height: 349px; /* dialogHeight - header - footer */
77-
}
85+
max-width: 100%;
86+
min-height: 0;
87+
max-height: 80%;
7888

7989
.mx_CompoundDialog_footer {
8090
box-shadow: 0px -4px 4px rgba(0, 0, 0, 0.05); /* hardcoded colour for both themes */
91+
z-index: 1; /* needed to make footer & shadow appear above dialog content */
8192
}
8293
}

src/components/views/dialogs/ScrollableBaseModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export default abstract class ScrollableBaseModal<
9696
aria-label={_t("Close dialog")}
9797
/>
9898
</div>
99-
<form onSubmit={this.onSubmit}>
99+
<form onSubmit={this.onSubmit} className="mx_CompoundDialog_form">
100100
<div className="mx_CompoundDialog_content">{this.renderContent()}</div>
101101
<div className="mx_CompoundDialog_footer">
102102
<AccessibleButton onClick={this.onCancel} kind="primary_outline">

0 commit comments

Comments
 (0)