Issue
I am using @ng-select/ng-select@2.3.6 in my application and i have a very long text in array.
So, the complete text not visible in dropdown list so I want to show the title/ tooltip over the each and every options
I tried,
let listArray = [{name: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s'}];
<ng-select placeholder="Select" (change)="onChange($event)">
<ng-option *ngFor="let list of listArray"
title="{{list.name}}"> {{list.name}} </ng-option>
</ng-select>
But no luck
Solution
you can achieve tooltip solution using below code
<ng-select [items]="listArray" bindLabel="name" bindValue="name">
<ng-template ng-option-tmp let-item="item">
<div title="{{item.name}}">{{item.name}}</div>
</ng-template>
</ng-select>
Thanks
Answered By - Kaushik Andani
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.