Skip to content

Commit 2c7bb08

Browse files
committed
Revert "fix(dialog): dialogs that hit max-width not centered on IE (#8055)" (#9430)
This reverts commit 65b63bb.
1 parent 96e6f83 commit 2c7bb08

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

src/cdk/overlay/_overlay.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
3939
display: flex;
4040
position: absolute;
4141
z-index: $cdk-z-index-overlay;
42-
43-
// Fixes issues where overlays are centered on IE when they hit the max-width.
44-
flex-direction: column;
4542
}
4643

4744
// A single overlay pane.

src/cdk/overlay/position/global-position-strategy.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ describe('GlobalPositonStrategy', () => {
4242
expect(elementStyle.marginBottom).toBe('');
4343
expect(elementStyle.marginRight).toBe('');
4444

45-
expect(parentStyle.alignItems).toBe('flex-start');
4645
expect(parentStyle.justifyContent).toBe('flex-start');
46+
expect(parentStyle.alignItems).toBe('flex-start');
4747
});
4848

4949
it('should position the element to the (bottom, right) with an offset', () => {
@@ -57,8 +57,8 @@ describe('GlobalPositonStrategy', () => {
5757
expect(elementStyle.marginBottom).toBe('70px');
5858
expect(elementStyle.marginRight).toBe('15em');
5959

60-
expect(parentStyle.alignItems).toBe('flex-end');
6160
expect(parentStyle.justifyContent).toBe('flex-end');
61+
expect(parentStyle.alignItems).toBe('flex-end');
6262
});
6363

6464
it('should overwrite previously applied positioning', () => {
@@ -73,8 +73,8 @@ describe('GlobalPositonStrategy', () => {
7373
expect(elementStyle.marginBottom).toBe('');
7474
expect(elementStyle.marginRight).toBe('');
7575

76-
expect(parentStyle.alignItems).toBe('flex-start');
7776
expect(parentStyle.justifyContent).toBe('flex-start');
77+
expect(parentStyle.alignItems).toBe('flex-start');
7878

7979
strategy.bottom('70px').right('15em').apply();
8080

@@ -83,17 +83,17 @@ describe('GlobalPositonStrategy', () => {
8383
expect(element.style.marginBottom).toBe('70px');
8484
expect(element.style.marginRight).toBe('15em');
8585

86-
expect(parentStyle.alignItems).toBe('flex-end');
8786
expect(parentStyle.justifyContent).toBe('flex-end');
87+
expect(parentStyle.alignItems).toBe('flex-end');
8888
});
8989

9090
it('should center the element', () => {
9191
strategy.centerHorizontally().centerVertically().apply();
9292

9393
let parentStyle = (element.parentNode as HTMLElement).style;
9494

95-
expect(parentStyle.alignItems).toBe('center');
9695
expect(parentStyle.justifyContent).toBe('center');
96+
expect(parentStyle.alignItems).toBe('center');
9797
});
9898

9999
it('should center the element with an offset', () => {
@@ -105,8 +105,8 @@ describe('GlobalPositonStrategy', () => {
105105
expect(elementStyle.marginLeft).toBe('10px');
106106
expect(elementStyle.marginTop).toBe('15px');
107107

108-
expect(parentStyle.alignItems).toBe('center');
109108
expect(parentStyle.justifyContent).toBe('center');
109+
expect(parentStyle.alignItems).toBe('center');
110110
});
111111

112112
it('should make the element position: static', () => {
@@ -150,14 +150,14 @@ describe('GlobalPositonStrategy', () => {
150150
strategy.centerHorizontally().width('100%').apply();
151151

152152
expect(element.style.marginLeft).toBe('0px');
153-
expect((element.parentNode as HTMLElement).style.alignItems).toBe('flex-start');
153+
expect((element.parentNode as HTMLElement).style.justifyContent).toBe('flex-start');
154154
});
155155

156156
it('should reset the vertical position and offset when the height is 100%', () => {
157157
strategy.centerVertically().height('100%').apply();
158158

159159
expect(element.style.marginTop).toBe('0px');
160-
expect((element.parentNode as HTMLElement).style.justifyContent).toBe('flex-start');
160+
expect((element.parentNode as HTMLElement).style.alignItems).toBe('flex-start');
161161
});
162162

163163
it('should not throw when attempting to apply after the overlay has been disposed', () => {

src/cdk/overlay/position/global-position-strategy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class GlobalPositionStrategy implements PositionStrategy {
4646
top(value: string = ''): this {
4747
this._bottomOffset = '';
4848
this._topOffset = value;
49-
this._justifyContent = 'flex-start';
49+
this._alignItems = 'flex-start';
5050
return this;
5151
}
5252

@@ -57,7 +57,7 @@ export class GlobalPositionStrategy implements PositionStrategy {
5757
left(value: string = ''): this {
5858
this._rightOffset = '';
5959
this._leftOffset = value;
60-
this._alignItems = 'flex-start';
60+
this._justifyContent = 'flex-start';
6161
return this;
6262
}
6363

@@ -68,7 +68,7 @@ export class GlobalPositionStrategy implements PositionStrategy {
6868
bottom(value: string = ''): this {
6969
this._topOffset = '';
7070
this._bottomOffset = value;
71-
this._justifyContent = 'flex-end';
71+
this._alignItems = 'flex-end';
7272
return this;
7373
}
7474

@@ -79,7 +79,7 @@ export class GlobalPositionStrategy implements PositionStrategy {
7979
right(value: string = ''): this {
8080
this._leftOffset = '';
8181
this._rightOffset = value;
82-
this._alignItems = 'flex-end';
82+
this._justifyContent = 'flex-end';
8383
return this;
8484
}
8585

@@ -123,7 +123,7 @@ export class GlobalPositionStrategy implements PositionStrategy {
123123
*/
124124
centerHorizontally(offset: string = ''): this {
125125
this.left(offset);
126-
this._alignItems = 'center';
126+
this._justifyContent = 'center';
127127
return this;
128128
}
129129

@@ -135,7 +135,7 @@ export class GlobalPositionStrategy implements PositionStrategy {
135135
*/
136136
centerVertically(offset: string = ''): this {
137137
this.top(offset);
138-
this._justifyContent = 'center';
138+
this._alignItems = 'center';
139139
return this;
140140
}
141141

0 commit comments

Comments
 (0)