{"action":"created","issue":{"url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/98","repository_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search","labels_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/98/comments","events_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/98/events","html_url":"https://github.com/christian-fei/Simple-Jekyll-Search/issues/98","id":306202465,"number":98,"title":"Trigger search with JavaScript","user":{"login":"JunShern","id":7796965,"avatar_url":"https://avatars3.githubusercontent.com/u/7796965?v=4","gravatar_id":"","url":"https://api.github.com/users/JunShern","html_url":"https://github.com/JunShern","followers_url":"https://api.github.com/users/JunShern/followers","following_url":"https://api.github.com/users/JunShern/following{/other_user}","gists_url":"https://api.github.com/users/JunShern/gists{/gist_id}","starred_url":"https://api.github.com/users/JunShern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JunShern/subscriptions","organizations_url":"https://api.github.com/users/JunShern/orgs","repos_url":"https://api.github.com/users/JunShern/repos","events_url":"https://api.github.com/users/JunShern/events{/privacy}","received_events_url":"https://api.github.com/users/JunShern/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-18T00:33:07Z","updated_at":"2018-03-18T02:12:49Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\n\r\nFirst of all, thank you for the wonderful library, I am hoping to using it on a website I am currently building.\r\n\r\nI want to have a feature where a user can click on a button (imagine tag or category buttons beneath the text input), and that button automatically populates the search box with the corresponding tag name, and performs the search.\r\n\r\nI have managed to achieve the first part of it by simply setting the search input's value to my desired text, and then I tried to trigger a key-up event but unfortunately this doesn't seem to trigger the search.\r\n\r\n```javascript\r\nfunction tagButtonClick(text) {\r\n    document.getElementById('search-input').value = text;\r\n    $('#search-input').trigger(jQuery.Event('keyup', {which: 65}));\r\n}\r\n```\r\n\r\nAny idea how I can achieve the effect I want?"},"comment":{"url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/comments/373967402","html_url":"https://github.com/christian-fei/Simple-Jekyll-Search/issues/98#issuecomment-373967402","issue_url":"https://api.github.com/repos/christian-fei/Simple-Jekyll-Search/issues/98","id":373967402,"user":{"login":"JunShern","id":7796965,"avatar_url":"https://avatars3.githubusercontent.com/u/7796965?v=4","gravatar_id":"","url":"https://api.github.com/users/JunShern","html_url":"https://github.com/JunShern","followers_url":"https://api.github.com/users/JunShern/followers","following_url":"https://api.github.com/users/JunShern/following{/other_user}","gists_url":"https://api.github.com/users/JunShern/gists{/gist_id}","starred_url":"https://api.github.com/users/JunShern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JunShern/subscriptions","organizations_url":"https://api.github.com/users/JunShern/orgs","repos_url":"https://api.github.com/users/JunShern/repos","events_url":"https://api.github.com/users/JunShern/events{/privacy}","received_events_url":"https://api.github.com/users/JunShern/received_events","type":"User","site_admin":false},"created_at":"2018-03-18T02:12:49Z","updated_at":"2018-03-18T02:12:49Z","author_association":"NONE","body":"Hi @christian-fei , thanks for the quick reply! I tried\r\n```javascript\r\n$('#search-input').trigger(jQuery.Event('keyup', {which: 13}));\r\n```\r\nand\r\n```javascript\r\n$('#search-input').trigger(jQuery.Event('keyup', {keycode: 13}));\r\n```\r\nas well, neither made a difference."}}
{"actor":{"display_login":"JunShern"}}