Skip to content

Commit 9ffd941

Browse files
committed
feat(desktop-ui): allow to pass ConnectedPosition strategy to dropdown component
1 parent bfa896c commit 9ffd941

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/desktop-ui/src/components/button/dropdown.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
ViewContainerRef,
3030
} from '@angular/core';
3131
import { TemplatePortal } from '@angular/cdk/portal';
32-
import { Overlay, OverlayConfig, OverlayRef, PositionStrategy } from '@angular/cdk/overlay';
32+
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef, PositionStrategy } from '@angular/cdk/overlay';
3333
import { Subscription } from 'rxjs';
3434
import { WindowRegistry } from '../window/window-state';
3535
import { focusWatcher } from '../../core/utils';
@@ -98,6 +98,8 @@ export class DropdownComponent implements OnChanges, OnDestroy, AfterViewInit {
9898
@Input() overlay: boolean | '' = false;
9999

100100
@Input() show?: boolean;
101+
@Input() connectedPositions: ConnectedPosition[] = [];
102+
101103
@Output() showChange = new EventEmitter<boolean>();
102104

103105
@Output() shown = new EventEmitter();
@@ -205,6 +207,7 @@ export class DropdownComponent implements OnChanges, OnDestroy, AfterViewInit {
205207
.withPush(true)
206208
.withDefaultOffsetY(this.overlay !== false ? 15 : 0)
207209
.withPositions([
210+
...this.connectedPositions,
208211
{
209212
originX: 'start',
210213
originY: 'bottom',
@@ -232,6 +235,7 @@ export class DropdownComponent implements OnChanges, OnDestroy, AfterViewInit {
232235
.withPush(true)
233236
.withDefaultOffsetY(this.overlay !== false ? 15 : 0)
234237
.withPositions([
238+
...this.connectedPositions,
235239
{
236240
originX: this.center ? 'center' : 'start',
237241
originY: 'bottom',

0 commit comments

Comments
 (0)