drewwilson / autosuggest Goto Github PK
View Code? Open in Web Editor NEWjQuery AutoComplete Plugin
Home Page: http://code.drewwilson.com/entry/autosuggest-jquery-plugin
jQuery AutoComplete Plugin
Home Page: http://code.drewwilson.com/entry/autosuggest-jquery-plugin
Hi. I'm unable to chenge data that AutoComplete uses to render suggestions. It can be assigned only when binding AutoComplete to input element.
I am able to retrieve data from my webservice but I don't know how to pass them to autocomplete a call some kind of rebind.
Is this possible, please? Help would be very appreciated!
Thank you.
Steps to reproduce:
EXPECTED: Item is removed
ACTUAL: The last item becomes selected.
Related issues:
There is a missing break;
statement before case 13:
(line 196) such that pressing becomes equivalent to pressing and in the same event.
Hi,
several months ago we used the 1.6 version of this plugin, as far as I know maintained by wuyuntao. at https://github.com/wuyuntao/jquery-autosuggest/. While making some additions, the feedback was not acceptable so we decide to fork the plugin and release it on our own (1.7) in order to provide the community our patches.
Starting today, I provide a so called AutoSuggest 2 at https://github.com/hlsolutions/jquery-autosuggest/ with following hot stuff :)
Please note the changelog, because some internals were changed. I.e., the internal value holder is now bullet proofed against the ,
.
In the meantime, I had fixed several bugs including some serious XSS issues. Also, the event names has changed in favor of a better readability and understanding.
The plugin itself has changed, but many details are still the same.
I would be pleased to know if you give it a try. We will try to discuss -- and integrate -- each PR in a more shorter response time.
Jan / @knalli
I use the input in an ajax submit, so I'd like to clean the widget correctly after submit.
the generated HTML is quite complex, do you have advice on which container I should empty or destroy ?
Everything seems fine, my server-side JSON source works, no firebug errors but the list does not show up.
I'm using jQuery 1.4.4 and the non-modifies CSS file.
I also tried the wunyuntao fork on github, same problem.
Use jQuery.each
instead of d_count
— IE8 returns true
for a property with obj.hasOwnProperty
compared to other browsers, resulting in a JavaScript error because d_count
which is based on .hasOwnProperty
is one too high, which means an array index is out of bounds.
jquery.autosuggest.js:168
values_input.val(values_input.val().replace(","+last+",",","));
Fails to replace the item if the item is the first in the series as there is no preceeding comma.
If you type special characters like [
(hard bracket) then regexps will fail.
This function will prevent this error:
function escapeRegExp(text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
}
Use it when you do text.search and when you call new RegExp() and you’ll be fine.
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library drewwilson/AutoSuggest
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "drewwilson/AutoSuggest",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
Also, JSONLint points thats the keys "value", "name" should be inside quotes, but if I use them, the scripts has an error on this line :
var str = data[num].value;
my json source in this case look like this when queried (names changed)
{ "items" :[ {"value":"692","name":"Ragdfma ACDFID"}, {"value":"686","name":"Altreine AKKJVRAM"}, {"value":"428","name":"Tfadftc ARALKMA"}, {"value":"2100","name":"Ikrazdme BOUPOFRA"}] }
We have noticed an issue on IPhone where when clicking in the dropdown that autosuggest displays, if there is a dropdown or other form control behind where you touch it opens the dropdown control that is hidden behind the autosuggest dropdown. Is there any way to prevent touches or clicks passing through the autosuggest dropdown and activating other controls that are hidden behind it when you click outside of the text of the dropdown option?
Thanks!
IE10 is inconsistent with other browsers as it shows the 'delete' button on the right while typing in the autosuggest. The expected behaviour is that the button is only shown when an actual selection has been made, not while typing. I can reproduce this consistently on the demo on your website and attached some screenshots as a reference.
Demo on autosuggest website in IE10:
How other browsers show this (no delete button on the right):
Using the latest Opera, the comma remains in the input element after adding an item. (Adding a return false;
did not help, in my local test.) This is despite e.preventDefault()
being called.
Steps to reproduce:
I assume this is a failing of Opera’s, but figured I would make an issue here anyway.
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.