Skip to content

Commit 82af2ff

Browse files
hsuanxyzvthinkxie
authored andcommitted
fix(module:auto-complete, mention, tree-select): update cdk overlay positioning strategy (#1761)
close #1756
1 parent 689f8b4 commit 82af2ff

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Diff for: components/auto-complete/nz-autocomplete-trigger.directive.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ export class NzAutocompleteTriggerDirective implements ControlValueAccessor, OnD
220220
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
221221
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
222222
];
223-
this.positionStrategy = this._overlay.position().flexibleConnectedTo(this.getConnectedElement()).withPositions(positions);
223+
this.positionStrategy = this._overlay.position()
224+
.flexibleConnectedTo(this.getConnectedElement())
225+
.withPositions(positions)
226+
.withFlexibleDimensions(false)
227+
.withPush(false);
224228
return this.positionStrategy;
225229
}
226230

Diff for: components/mention/mention.component.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ export class NzMentionComponent implements OnDestroy, AfterContentInit {
334334
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
335335
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
336336
];
337-
this.positionStrategy = this.overlay.position().flexibleConnectedTo(this.trigger.el).withPositions(positions).withLockedPosition(true);
337+
this.positionStrategy = this.overlay.position()
338+
.flexibleConnectedTo(this.trigger.el)
339+
.withPositions(positions)
340+
.withFlexibleDimensions(false)
341+
.withPush(false);
338342
return this.positionStrategy;
339343
}
340344

Diff for: components/tree-select/nz-tree-select.component.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ export class NzTreeSelectComponent implements ControlValueAccessor, OnInit, Afte
270270
new ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
271271
new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'bottom' })
272272
];
273-
this.positionStrategy = this.overlay.position().flexibleConnectedTo(this.treeSelect).withPositions(positions).withLockedPosition(true);
273+
this.positionStrategy = this.overlay.position()
274+
.flexibleConnectedTo(this.treeSelect)
275+
.withPositions(positions)
276+
.withFlexibleDimensions(false)
277+
.withPush(false);
274278
return this.positionStrategy;
275279
}
276280

0 commit comments

Comments
 (0)