I'm currently working on an input text with values proposals, this is the html :
<div>
<input type="text"/>
<ul>
<li>Value 1</li>
<li>Value 2</li>
<li>Value 3</li>
</ul>
</div>
And with jQuery I have bind 2 events :
// On click on proposal, change the input value
$('li').click(function(){
$('input').val($(this).text());
});
// On input blur, close proposal
$('input').blur(function(){
$('ul').hide();
});
But now, I have a big problem.. When I click on li, the first event launch are the input blur, so the ul are hided and the click event are never been called..
I have read some solution (like this one) but in my case, the blue event hide the click zone, so my second event can't be called.
How can I do to manage this conflict ?!