I have a dropdown that is initialized with one single value. When the user clicks it, the single element is removed and a new element is added saying "Loading", then an AJAX call is issued to the server and when returns, the new values are added to the control.
The problem is that the control remains open while updating, and I would like to close it.
This is an example: http://jsfiddle.net/vtortola/CGuBk/2/
The example's AJAX does not get data probably because something wrong I am doing when calling the jsfiddle api, but it shows how the SELECT
remains open during update.
I want to know how to close the dropdown list programmatically w/o focus in another input.
Just add this line end of your close within
click
.So it will look like
DEMO
HAH ! If we have an issue with Chrome new version then:
Take a fake
select
like following:and do something like:
DEMO
Old post I know but I have a very simple solution.
That will collapse the select element if you click on any item in the list.
I think all you need to do is target something else or should I say lose focus on the select (blur it)