I am currently working on creating a custom searchable input field that makes backend calls. Instead of using datalist, I want to design a unique UI with ul and li items. While I have successfully implemented the search functionality, I am facing a glitch with the UI. I am trying to display the ul when the input is focused, but when I attempt to hide the ul on blur of the input, the ul disappears before I can select an item. What would be the correct CSS approach for this scenario?
<input placeholder (blur)=“focussed=false” (focus)=“focussed=true” (keyup)=“filterData($event.target.value) ”/>
<ul *ngIf=“focussed”>
<li *ngFor=“item of filteredItems” >{{item}}</li>
</ul>