You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 26, 2019. It is now read-only.
Found out with testing that .destory() does not properly remove binding. Example Code:
`window.autocomplete = new TeleportAutocomplete({
el: '#search-box',
maxItems: 5,
geoLocate: false
});
$('#search-by-keyword span').on('click', function() {
window.autocomplete.destroy();
}`
After clicking the span identified, you can type into the box, but on pressing 'enter' the keydown bind for TeleportAutocomplete will fire. This can be corrected by commenting out lines 58-59:
Found out with testing that .destory() does not properly remove binding. Example Code:
`window.autocomplete = new TeleportAutocomplete({
el: '#search-box',
maxItems: 5,
geoLocate: false
});
$('#search-by-keyword span').on('click', function() {
window.autocomplete.destroy();
}`
After clicking the span identified, you can type into the box, but on pressing 'enter' the keydown bind for TeleportAutocomplete will fire. This can be corrected by commenting out lines 58-59:
// Shorthands
//HTMLElement.prototype.on = HTMLElement.prototype.addEventListener;
//HTMLElement.prototype.off = HTMLElement.prototype.removeEventListener;
and converting all .on/.off calls to jQuery.on/.off.
This may only be a problem when autocomplete is used in combination with jQuery. I have not tested this without.
The text was updated successfully, but these errors were encountered: