{"action":"created","issue":{"url":"https://api.github.com/repos/uikit/uikit/issues/611","repository_url":"https://api.github.com/repos/uikit/uikit","labels_url":"https://api.github.com/repos/uikit/uikit/issues/611/labels{/name}","comments_url":"https://api.github.com/repos/uikit/uikit/issues/611/comments","events_url":"https://api.github.com/repos/uikit/uikit/issues/611/events","html_url":"https://github.com/uikit/uikit/issues/611","id":42173509,"number":611,"title":"autocomplete - how to bind a select handler?","user":{"login":"luetn","id":6003040,"avatar_url":"https://avatars.githubusercontent.com/u/6003040?v=3","gravatar_id":"","url":"https://api.github.com/users/luetn","html_url":"https://github.com/luetn","followers_url":"https://api.github.com/users/luetn/followers","following_url":"https://api.github.com/users/luetn/following{/other_user}","gists_url":"https://api.github.com/users/luetn/gists{/gist_id}","starred_url":"https://api.github.com/users/luetn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luetn/subscriptions","organizations_url":"https://api.github.com/users/luetn/orgs","repos_url":"https://api.github.com/users/luetn/repos","events_url":"https://api.github.com/users/luetn/events{/privacy}","received_events_url":"https://api.github.com/users/luetn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2014-09-08T08:16:36Z","updated_at":"2016-12-18T10:44:31Z","closed_at":"2014-09-15T08:29:49Z","body":"how is it possible to execute a select handler not only for click but also for keyboard select events?\nExample Code from uikit page with additional data-id value\n\n``` code\n<div class=\"uk-autocomplete uk-form\" data-uk-autocomplete=\"{source:'my-autocomplete.json'}\">\n    <input type=\"text\">\n    <script type=\"text/autocomplete\">\n        <ul class=\"uk-nav uk-nav-autocomplete uk-autocomplete-results\">\n            {{~items}}\n            <li class=\"clicked\" data-value=\"{{ $item.value }}\"  data-id=\"{{ $item.id }}\">\n                <a>\n                    {{ $item.title }}\n                    <div>{{{ $item.text }}}</div>\n                </a>\n            </li>\n            {{/items}}\n        </ul>\n    </script>\n</div>\n```\n\n``` javascript\n<script>\n$(document).ready(function() {\n$(document).on( \"click\", \"li.clicked\", function(  ) {\n   alert($(this).attr('data-id'));\n});\n// The question here: how to bind this handler when a value \n// has been selected by keyboard and return key?\n});\n</script>\n```\n\nmy-autocomplete.json like\n\n[\n    {\"value\":\"Hamburg\", \"title\":\"Hamburg title\", \"url\":\"#\", \"text\":\"Lorem ipsum dolor sit amet, consectetur ...\",\"id\":\"444\"},\n    {\"value\":\"New York\", \"title\":\"New York\", \"url\":\"#\", \"text\":\"Ut enim ad minim veniam, quis nostrud ...\",\"id\":\"4344\"},\n    {\"value\":\"Moscow\", \"title\":\"Moscow\", \"url\":\"#\", \"text\":\"Duis aute irure dolor in reprehenderit ...\",\"id\":4444},\n    {\"value\":\"Amsterdam\", \"title\":\"Amsterdam\", \"url\":\"#\", \"text\":\"Excepteur sint occaecat cupidatat non ...\",\"id\":4454}\n]\n"},"comment":{"url":"https://api.github.com/repos/uikit/uikit/issues/comments/267814436","html_url":"https://github.com/uikit/uikit/issues/611#issuecomment-267814436","issue_url":"https://api.github.com/repos/uikit/uikit/issues/611","id":267814436,"user":{"login":"abuzant","id":9941513,"avatar_url":"https://avatars.githubusercontent.com/u/9941513?v=3","gravatar_id":"","url":"https://api.github.com/users/abuzant","html_url":"https://github.com/abuzant","followers_url":"https://api.github.com/users/abuzant/followers","following_url":"https://api.github.com/users/abuzant/following{/other_user}","gists_url":"https://api.github.com/users/abuzant/gists{/gist_id}","starred_url":"https://api.github.com/users/abuzant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abuzant/subscriptions","organizations_url":"https://api.github.com/users/abuzant/orgs","repos_url":"https://api.github.com/users/abuzant/repos","events_url":"https://api.github.com/users/abuzant/events{/privacy}","received_events_url":"https://api.github.com/users/abuzant/received_events","type":"User","site_admin":false},"created_at":"2016-12-18T10:44:31Z","updated_at":"2016-12-18T10:44:31Z","body":"This is one and probably the worst documented feature of the whole UIKIt library. Guys here wrote long great docs for the uk-icon and uk-grid for example which are basic things leaving complex components like this poorly documented. I couch for a complete rewrite for it's docs. "}}
{"actor":{"display_login":"abuzant"}}