use flexibleConnectedTo and remove deprecated (#7747)

This commit is contained in:
Maurizio Vitale 2022-08-04 17:40:56 +02:00 committed by GitHub
parent 6153e55d1a
commit d8d1119495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,27 +101,15 @@ export class ContextMenuOverlayService {
} as any) } as any)
}; };
const positionStrategy = this.overlay.position() const positionStrategy = this.overlay
.connectedTo( .position()
new ElementRef(fakeElement), .flexibleConnectedTo(new ElementRef(fakeElement))
{ originX: 'start', originY: 'bottom' }, .withPositions([{
{ overlayX: 'start', overlayY: 'top' }) originX: 'start',
.withFallbackPosition( originY: 'bottom',
{ originX: 'start', originY: 'top' }, overlayX: 'start',
{ overlayX: 'start', overlayY: 'bottom' }) overlayY: 'top'
.withFallbackPosition( }]);
{ originX: 'end', originY: 'top' },
{ overlayX: 'start', overlayY: 'top' })
.withFallbackPosition(
{ originX: 'start', originY: 'top' },
{ overlayX: 'end', overlayY: 'top' })
.withFallbackPosition(
{ originX: 'end', originY: 'center' },
{ overlayX: 'start', overlayY: 'center' })
.withFallbackPosition(
{ originX: 'start', originY: 'center' },
{ overlayX: 'end', overlayY: 'center' }
);
const overlayConfig = new OverlayConfig({ const overlayConfig = new OverlayConfig({
hasBackdrop: config.hasBackdrop, hasBackdrop: config.hasBackdrop,