jquery autocomplete unbind bug
Shows bug when trying to unbind event handlers created as options in constructor.
HTML
<link rel="stylesheet" href="http://jqueryui.com/css/base.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/base/jquery-ui.css">
<input type="text" id="t1" />
<br />
<input type="text" id="t2" />
JavaScript
$(function() {
//t1 doesn't work
$('#t1').autocomplete({
source: "aaa aab bbbb bbc cccc ccd dddd dde".split(' '),
select: function(event, ui) {
alert('selected: ' + ui.item.value);
}
});
$('#t1').unbind("autocompleteselect");
//t2 works
$('#t2').autocomplete({
source: "aaa aab bbbb bbc cccc ccd dddd dde".split(' ')
});
$('#t2').bind('autocompleteselect', function(event, ui) {
alert('selected: ' + ui.item.value);
});
$('#t2').unbind("autocompleteselect");
});