-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Awesomplete with one field crashes #16790
Comments
In this case it treats the value of data-list attribute to as CSS selector, not a comma-separated list of values. See https://github.com/LeaVerou/awesomplete/blob/gh-pages/awesomplete.js#L120-L123 @IonicaBizau I'm curious, what is your use case, where you get this error? |
@vlazar I have an array of strings and I But anyway, I guess the error should be friendlier. 📝 |
@IonicaBizau Since you already have an array of strings, you can use another way as described in docs: var input = document.getElementById("myinput");
new Awesomplete(input, {
list: ["Ada", "Java", "JavaScript", "Brainfuck", "LOLCODE", "Node.js", "Ruby on Rails"]
}); However, someone may prefer to put inline list in I feel this is related to #16725 (comment) . Maybe // init from some element with CSS selector
completer.list = "#some-id";
completer.list; // "#some-id"
completer.items; // [ "array", "of", "items", "from", "some-id" ];
// init from items (Array or comma-separated list)
completer.items = [ "list", "of", "items" ];
completer.items; // [ "list", "of", "items" ]
completer.items = "comma,separated,list";
completer.items; // [ "comma", "separated", "list" ] |
I discovered this little thing: if the input has
data-list="Ada"
, Awesomplete will not work:@LeaVerou Nice project! ✨
The text was updated successfully, but these errors were encountered: