I am trying to create a searchable input with backend call. Instead of using datalist I would like to create custome UI with ul and li items. I am able to get the search functionality working but UI seems to be having glich I am trying to show ul when input focussed and but when try to use on blur of input to hide the ul when I do so before selecting the item in ul blur is fired and ul is hidden. What should be the right css for this case.
<input placeholder (blur)=“focussed=false” (focus)=“focussed=true” (keyup)=“filterData($event.target.value) ”/>
<ul *ngIf=“focussed”>
<li *ngFor=“item of filteredItems” >{{item}}</li>
</ul>