Skip to content

Commit

Permalink
fix: appended dropdown position (ng-select#957)
Browse files Browse the repository at this point in the history
fixes issue ng-select#955
  • Loading branch information
imkremen authored and anjmao committed Dec 18, 2018
1 parent 02a35c9 commit e8b0db8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ng-select/ng-dropdown-panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,10 @@ export class NgDropdownPanelComponent implements OnInit, OnChanges, OnDestroy, A

private _updateAppendedDropdownPosition() {
const parent = document.querySelector(this.appendTo) || document.body;
this._dropdown.style.display = 'none';
const selectRect: ClientRect = this._select.getBoundingClientRect();
const boundingRect = parent.getBoundingClientRect();
this._dropdown.style.display = '';
const offsetTop = selectRect.top - boundingRect.top;
const offsetLeft = selectRect.left - boundingRect.left;
const topDelta = this._currentPosition === 'bottom' ? selectRect.height : -this._dropdown.clientHeight;
Expand Down

0 comments on commit e8b0db8

Please sign in to comment.