From c6d483535a36b5814d1f3ff708752ec0d882c8f2 Mon Sep 17 00:00:00 2001 From: Dmitriy Shekhovtsov Date: Tue, 27 Dec 2016 16:01:18 +0200 Subject: [PATCH] fix(typeahead): fixed typeahead positioning inside form-inline fixes #1396 --- src/positioning/ng-positioning.ts | 4 ++-- src/typeahead/typeahead-container.component.ts | 2 +- src/typeahead/typeahead.directive.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/positioning/ng-positioning.ts b/src/positioning/ng-positioning.ts index c9cd5dc442..9fcf9a754c 100644 --- a/src/positioning/ng-positioning.ts +++ b/src/positioning/ng-positioning.ts @@ -83,8 +83,8 @@ export class Positioning { bottom: hostElPosition.top + hostElPosition.height }; const targetElBCR = targetElement.getBoundingClientRect(); - const placementPrimary = placement.split('-')[0] || 'top'; - const placementSecondary = placement.split('-')[1] || 'center'; + const placementPrimary = placement.split(' ')[0] || 'top'; + const placementSecondary = placement.split(' ')[1] || 'center'; let targetElPosition: ClientRect = { height: targetElBCR.height || targetElement.offsetHeight, diff --git a/src/typeahead/typeahead-container.component.ts b/src/typeahead/typeahead-container.component.ts index 9d5a826b9b..d92e54e7b6 100644 --- a/src/typeahead/typeahead-container.component.ts +++ b/src/typeahead/typeahead-container.component.ts @@ -60,7 +60,7 @@ import { TypeaheadMatch } from './typeahead-match.class'; `, // tslint:disable-next-line - host: {'[class]': '"dropdown open"'}, + host: {'class': 'dropdown open', style: 'position: absolute;' }, encapsulation: ViewEncapsulation.None }) export class TypeaheadContainerComponent { diff --git a/src/typeahead/typeahead.directive.ts b/src/typeahead/typeahead.directive.ts index 5cabc8a686..c8669a9a8a 100644 --- a/src/typeahead/typeahead.directive.ts +++ b/src/typeahead/typeahead.directive.ts @@ -217,8 +217,8 @@ export class TypeaheadDirective implements OnInit, OnDestroy { this._typeahead .attach(TypeaheadContainerComponent) // todo: add append to body, after updating positioning service - // .to(this.container) - // .position({attachment: 'bottom left'}) + .to(this.container) + .position({attachment: 'bottom left'}) .show({ typeaheadRef: this, placement: this.placement,