Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[typeahead] Setting a tooltip in the layout of optionsListTemplate causes a console error, and the typeahead position is being controlled automatically even though adaptivePosition is not set. #6676

Open
tranquocbaodev opened this issue Aug 8, 2024 · 0 comments

Comments

@tranquocbaodev
Copy link

Setting a tooltip in the layout of optionsListTemplate causes a console error, and the typeahead position is being controlled automatically even though adaptivePosition is not set.

ngx-bootstrap: ^12.0.0
Angular: 17.3.8
Bootstrap: 5.2.3

<div class="content" style="width: 200px;">
  <pre>Lorem Ipsum dolor</pre>
  <pre>Lorem Ipsum dolor</pre>
  <pre>Lorem Ipsum dolor</pre>
  <pre>Lorem Ipsum dolor</pre>
  <pre>Lorem Ipsum dolor</pre>
  <pre>Lorem Ipsum dolor</pre>
  <pre>Lorem Ipsum dolor</pre>
  <pre class="card card-block card-header mb-3">Model: {{selected | json}}</pre>
  <input
    [(ngModel)]="selected"
    [typeahead]="states"
    container="body"
    [optionsListTemplate]="customListTemplate"
    class="form-control"
  />
</div>

<ng-template #customListTemplate let-matches="matches" let-query="query" let-typeaheadTemplateMethods>
  <ul class="custom-list-group">
    <li
      class="custom-list-group-item"
      *ngFor="let match of matches"
      [class.active]="typeaheadTemplateMethods.isActive(match)"
      (click)="typeaheadTemplateMethods.selectMatch(match, $event)"
      (mouseenter)="typeaheadTemplateMethods.selectActive(match)"
      [tooltip]="match.item"
    >
      {{ match.item }}
    </li>
  </ul>
</ng-template>

It seems that when hovering over a record, the position of the tooltip is also controlling the typeahead, causing an error. I think this might be a bug in the position calculation service of the library.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant