A little bit better but some problems are present.

When I click on the button the dropdown doesn’t show and the content is cleared : I need to click another time in order to show the dropdown.

When the value is cleared, if I press tab I get an error : t is undefined.

Least but not last the dropdown apparence is different from your example and my implementation : the heigth of every element in the dropdown is much higher in my implementation but I didn’t set any css class.