Skip to content

Commit

Permalink
fix(typeahead): fixed typeahead positioning inside form-inline
Browse files Browse the repository at this point in the history
fixes #1396
  • Loading branch information
valorkin committed Dec 27, 2016
1 parent dd54f63 commit c6d4835
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/positioning/ng-positioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/typeahead/typeahead-container.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import { TypeaheadMatch } from './typeahead-match.class';
</div></template>
`,
// tslint:disable-next-line
host: {'[class]': '"dropdown open"'},
host: {'class': 'dropdown open', style: 'position: absolute;' },
encapsulation: ViewEncapsulation.None
})
export class TypeaheadContainerComponent {
Expand Down
4 changes: 2 additions & 2 deletions src/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c6d4835

Please sign in to comment.