teleport / autocomplete Goto Github PK
View Code? Open in Web Editor NEWTeleport Cities Autocomplete
License: MIT License
Teleport Cities Autocomplete
License: MIT License
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.
Every time teleport/autocomplete is initialized on one input with a value it automatically performs a query. I guess it isn't a bug but is there any way to prevent this? Thanks.
This allows to use component as a picker than form element.
If name contains diacritics, a filtered name (without diacritics) is appended to full_name. Ex:
full_name: "Münchenstein, Basel-Landschaft, Switzerland (Munchenstein)"
name: "Münchenstein"
But it's not always the case. Ex:
full_name: "Saint-Dié-des-Vosges, Grand Est, France"
name: "Saint-Dié-des-Vosges"
How to prevent this addition ? Or how to make it systematic when there are accents in the name ?
Is it possible to only search within one country ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.