Skip to content

Commit 38c11fc

Browse files
author
Luke Bowerman
authored
Correct bug where DialogHeader & DialogFooter shrink in Safari (#1552)
1 parent 7562fed commit 38c11fc

File tree

5 files changed

+36
-17
lines changed

5 files changed

+36
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4545
### Fixed
4646

4747
- `ComboboxMulti` issue with chips not updating reflecting updated option labels
48+
- `DialogFooter` & `DialogHeader` will no longer shrink in Safari when vertical space is limited
4849
- `InputTimeSelect` disabled state
4950

5051
### Removed

packages/components/src/Dialog/Layout/DialogFooter.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export const DialogFooterLayout: FC<DialogFooterProps> = ({
5151
)
5252
}
5353

54-
export const DialogFooter = styled(DialogFooterLayout)``
54+
export const DialogFooter = styled(DialogFooterLayout)`
55+
flex-shrink: 0;
56+
`
5557

5658
DialogFooter.defaultProps = {
5759
px: 'xlarge',

packages/components/src/Dialog/Layout/DialogHeader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export const DialogHeader = styled(DialogHeaderLayout)`
116116
${space}
117117
align-items: center;
118118
display: flex;
119+
flex-shrink: 0;
119120
`
120121

121122
DialogHeader.defaultProps = {

packages/components/src/Dialog/Layout/__snapshots__/DialogFooter.test.tsx.snap

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ exports[`DialogFooter with Button 1`] = `
2525
justify-content: space-between;
2626
}
2727
28-
.c1 {
28+
.c2 {
2929
font-family: 'Roboto','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI','Helvetica','Arial',sans-serif;
3030
width: 100%;
3131
-webkit-align-items: center;
@@ -41,38 +41,44 @@ exports[`DialogFooter with Button 1`] = `
4141
flex-direction: row-reverse;
4242
}
4343
44+
.c1 {
45+
-webkit-flex-shrink: 0;
46+
-ms-flex-negative: 0;
47+
flex-shrink: 0;
48+
}
49+
4450
@supports (-moz-appearance:none) {
45-
.c1 {
51+
.c2 {
4652
gap: 0 1rem;
4753
}
4854
}
4955
5056
@supports not (-moz-appearance:none) {
51-
.c1.c1 > * {
57+
.c2.c2 > * {
5258
margin-right: 1rem;
5359
}
5460
55-
.c1.c1 > *:first-child {
61+
.c2.c2 > *:first-child {
5662
margin-right: 0rem;
5763
}
5864
}
5965
6066
@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none) {
61-
.c1.c1 > * {
67+
.c2.c2 > * {
6268
margin-right: 1rem;
6369
}
6470
65-
.c1.c1 > *:first-child {
71+
.c2.c2 > *:first-child {
6672
margin-right: 0rem;
6773
}
6874
}
6975
7076
<footer
71-
className="c0 "
77+
className="c0 c1"
7278
width="100%"
7379
>
7480
<div
75-
className="c1"
81+
className="c2"
7682
width="100%"
7783
>
7884
<button>
@@ -107,7 +113,7 @@ exports[`DialogFooter with DialogContext 1`] = `
107113
justify-content: space-between;
108114
}
109115
110-
.c1 {
116+
.c2 {
111117
font-family: 'Roboto','Noto Sans JP','Noto Sans CJK KR','Noto Sans Arabic UI','Noto Sans Devanagari UI','Noto Sans Hebrew','Noto Sans Thai UI','Helvetica','Arial',sans-serif;
112118
width: 100%;
113119
-webkit-align-items: center;
@@ -123,38 +129,44 @@ exports[`DialogFooter with DialogContext 1`] = `
123129
flex-direction: row-reverse;
124130
}
125131
132+
.c1 {
133+
-webkit-flex-shrink: 0;
134+
-ms-flex-negative: 0;
135+
flex-shrink: 0;
136+
}
137+
126138
@supports (-moz-appearance:none) {
127-
.c1 {
139+
.c2 {
128140
gap: 0 1rem;
129141
}
130142
}
131143
132144
@supports not (-moz-appearance:none) {
133-
.c1.c1 > * {
145+
.c2.c2 > * {
134146
margin-right: 1rem;
135147
}
136148
137-
.c1.c1 > *:first-child {
149+
.c2.c2 > *:first-child {
138150
margin-right: 0rem;
139151
}
140152
}
141153
142154
@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none) {
143-
.c1.c1 > * {
155+
.c2.c2 > * {
144156
margin-right: 1rem;
145157
}
146158
147-
.c1.c1 > *:first-child {
159+
.c2.c2 > *:first-child {
148160
margin-right: 0rem;
149161
}
150162
}
151163
152164
<footer
153-
className="c0 "
165+
className="c0 c1"
154166
width="100%"
155167
>
156168
<div
157-
className="c1"
169+
className="c2"
158170
width="100%"
159171
>
160172
<button

packages/components/src/Dialog/Layout/__snapshots__/DialogHeader.test.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ exports[`DialogHeader Snapshot 1`] = `
124124
display: -webkit-flex;
125125
display: -ms-flexbox;
126126
display: flex;
127+
-webkit-flex-shrink: 0;
128+
-ms-flex-negative: 0;
129+
flex-shrink: 0;
127130
}
128131
129132
<header

0 commit comments

Comments
 (0)