{"action":"created","issue":{"url":"https://api.github.com/repos/LeaVerou/awesomplete/issues/16978","repository_url":"https://api.github.com/repos/LeaVerou/awesomplete","labels_url":"https://api.github.com/repos/LeaVerou/awesomplete/issues/16978/labels{/name}","comments_url":"https://api.github.com/repos/LeaVerou/awesomplete/issues/16978/comments","events_url":"https://api.github.com/repos/LeaVerou/awesomplete/issues/16978/events","html_url":"https://github.com/LeaVerou/awesomplete/issues/16978","id":179373483,"number":16978,"title":"Difficulty with data-multiple","user":{"login":"gersonvan","id":7863732,"avatar_url":"https://avatars.githubusercontent.com/u/7863732?v=3","gravatar_id":"","url":"https://api.github.com/users/gersonvan","html_url":"https://github.com/gersonvan","followers_url":"https://api.github.com/users/gersonvan/followers","following_url":"https://api.github.com/users/gersonvan/following{/other_user}","gists_url":"https://api.github.com/users/gersonvan/gists{/gist_id}","starred_url":"https://api.github.com/users/gersonvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gersonvan/subscriptions","organizations_url":"https://api.github.com/users/gersonvan/orgs","repos_url":"https://api.github.com/users/gersonvan/repos","events_url":"https://api.github.com/users/gersonvan/events{/privacy}","received_events_url":"https://api.github.com/users/gersonvan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LeaVerou/awesomplete/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-27T00:55:21Z","updated_at":"2016-09-30T13:36:53Z","closed_at":"2016-09-30T10:52:28Z","body":"Hi everyone,\r\n\r\nI'm facing difficulties using data-multiple. During the last week I've been trying several approaches to make it work with no sucess.\r\n\r\nI'm listing the content, but it is not inserting the comma and giving the option of a new select.\r\n\r\nI've added in my application.js the following:\r\n\r\n`new Awesomplete('input[data-multiple]', {\r\n\tfilter: function(text, input) {\r\n\t\treturn Awesomplete.FILTER_CONTAINS(text, input.match(/[^,]*$/)[0]);\r\n\t},\r\n\treplace: function(text) {\r\n\t\tvar before = this.input.value.match(/^.+,\\s*|/)[0];\r\n\t\tthis.input.value = before + text + \", \";\r\n\t}\r\n});`\r\n\r\nand in my _form.html.erb for this input, I'm using:\r\n\r\n`<%= f.text_field :objeto_de_acao, :class => 'awesomplete', :list => 'objetos', :data => { :multiple => ''} %>\r\n<datalist id=\"objetos\">\r\n\t<% action_objects_array.each do |action_object| %>\r\n\t     <option><%= action_object[0].to_s %></option>\r\n\t<%end%>\r\n</datalist>`\r\n\r\nFor what I've seen in the advanced examples, this is all I probably need to do. Am I missing anything?\r\n\r\nthanks ins advance."},"comment":{"url":"https://api.github.com/repos/LeaVerou/awesomplete/issues/comments/250746029","html_url":"https://github.com/LeaVerou/awesomplete/issues/16978#issuecomment-250746029","issue_url":"https://api.github.com/repos/LeaVerou/awesomplete/issues/16978","id":250746029,"user":{"login":"LeaVerou","id":175836,"avatar_url":"https://avatars.githubusercontent.com/u/175836?v=3","gravatar_id":"","url":"https://api.github.com/users/LeaVerou","html_url":"https://github.com/LeaVerou","followers_url":"https://api.github.com/users/LeaVerou/followers","following_url":"https://api.github.com/users/LeaVerou/following{/other_user}","gists_url":"https://api.github.com/users/LeaVerou/gists{/gist_id}","starred_url":"https://api.github.com/users/LeaVerou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeaVerou/subscriptions","organizations_url":"https://api.github.com/users/LeaVerou/orgs","repos_url":"https://api.github.com/users/LeaVerou/repos","events_url":"https://api.github.com/users/LeaVerou/events{/privacy}","received_events_url":"https://api.github.com/users/LeaVerou/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T13:36:53Z","updated_at":"2016-09-30T13:36:53Z","body":"Don't we already put an `awesomplete` property on the inputs that points to the instance? I believe there was a feature request for that a while ago. If so, we don't need a map. If not, we can add it and shoot two birds with one stone.\r\n\r\nA `destroy()` method is needed anyway, and I believe it has been requested in the past as well.\r\n\r\nNot sure I get what you mean about events. We have no way of knowing what user event listeners there are, so not sure how you propose removing them, even if we did agree that it would have been a good idea."}}
{"actor":{"display_login":"LeaVerou"}}