jQuery Autocomplete Duplicate Remove event listener
While trying to determine what was slowing down my autocomplete text box, I noticed that every time the user types in the target text box the number of event listeners would go up. It looks like autocomplete is adding duplicate "remove" events to the target. This can be reproduced by adding the following line to the default autocomplete example at
https://jqueryui.com/autocomplete/ .
- response: function (e, ui) {
- console.log( jQuery._data( $("#tags")[0], "events" ) );
- }
When looking at the results in chrome's developer tools I can see the number of event listeners go up every time the the user types in the target text box.
- Object {remove: Array[3], keydown: Array[1], keypress: Array[1], input: Array[1]...
- Object {remove: Array[5], keydown: Array[1], keypress: Array[1], input: Array[1]...
- Object {remove: Array[7], keydown: Array[1], keypress: Array[1], input: Array[1]...
- Object {remove: Array[9], keydown: Array[1], keypress: Array[1], input: Array[1]...
This seems like a bug to me but I thought I would run this by the forum before submitting a bug report. Has anyone else ever come across this before or have any suggestions on how to fix it?
Thanks for the help.