{"action":"opened","issue":{"url":"https://api.github.com/repos/selectize/selectize.js/issues/1240","repository_url":"https://api.github.com/repos/selectize/selectize.js","labels_url":"https://api.github.com/repos/selectize/selectize.js/issues/1240/labels{/name}","comments_url":"https://api.github.com/repos/selectize/selectize.js/issues/1240/comments","events_url":"https://api.github.com/repos/selectize/selectize.js/issues/1240/events","html_url":"https://github.com/selectize/selectize.js/issues/1240","id":204032636,"number":1240,"title":"After migrating from 1.12.1 to 1.12.4 the labelField option is ignored","user":{"login":"bb1","id":3842623,"avatar_url":"https://avatars.githubusercontent.com/u/3842623?v=3","gravatar_id":"","url":"https://api.github.com/users/bb1","html_url":"https://github.com/bb1","followers_url":"https://api.github.com/users/bb1/followers","following_url":"https://api.github.com/users/bb1/following{/other_user}","gists_url":"https://api.github.com/users/bb1/gists{/gist_id}","starred_url":"https://api.github.com/users/bb1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bb1/subscriptions","organizations_url":"https://api.github.com/users/bb1/orgs","repos_url":"https://api.github.com/users/bb1/repos","events_url":"https://api.github.com/users/bb1/events{/privacy}","received_events_url":"https://api.github.com/users/bb1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-30T14:57:47Z","updated_at":"2017-01-30T14:57:47Z","closed_at":null,"body":"* [x] Search for if my issue has already been submitted\r\n* [x] Make sure I'm reporting something precise that needs to be fixed\r\n* [x] Give my issue a descriptive and concise title\r\n* [x] JsFiddle https://jsfiddle.net/z1cs0420/4/\r\n* [x] Indicate *precise* steps to reproduce in *numbers* and the result below\r\n\r\nSteps to reproduce:\r\n\r\n1. Set up a selectize with labelField changed\r\n`$(\"#\"+id).selectize({labelField : 'value', load: function(query, callback) {\r\n  loadFunc(id, query, callback);\r\n}});`\r\n2. use the callback from the load-Option to fill the Box\r\n3. Try again with $.map() and add a text attribute to each object\r\n\r\nResult:\r\n![Screenshot](https://abload.de/img/selectize_labelfield_3mset.png)\r\n\r\nOkay I need some help here. This bug suddenly appeared after I upgraded from 1.12.1 to the newest release. But when I tried to reproduce it in a JsFiddle it worked. I used the exact same configurations minus the Ajax-Request.\r\n\r\nI had to add an ugly work-around to make it work: I map the server response to fit the default configuration:\r\n`success : function(res) {\r\n\tvar cleaned = $.map(res, function(val, i){\r\n\t\treturn {\r\n\t\t\tvalue: val.value,\r\n\t\t\ttext: val.value\r\n\t\t};\r\n\t});\r\n\tcallback(cleaned);\r\n}`\r\n\r\nI know this is more or less useless without steps to reproduce. Maybe it helps if I add some more information:\r\njQuery 1.11.2,\r\n$.ui.version \"1.11.0\"\r\n`$(\"#selectId\")[0].selectize.settings.labelField // \"test\"`\r\n\r\nOr maybe someone else has the same problem or any idea what it may cause."}}
{"actor":{"display_login":"bb1"}}