{"action":"created","issue":{"url":"https://api.github.com/repos/chmln/flatpickr/issues/623","repository_url":"https://api.github.com/repos/chmln/flatpickr","labels_url":"https://api.github.com/repos/chmln/flatpickr/issues/623/labels{/name}","comments_url":"https://api.github.com/repos/chmln/flatpickr/issues/623/comments","events_url":"https://api.github.com/repos/chmln/flatpickr/issues/623/events","html_url":"https://github.com/chmln/flatpickr/issues/623","id":207912042,"number":623,"title":"Keyboard support","user":{"login":"cyrilmesvayn","id":25802689,"avatar_url":"https://avatars1.githubusercontent.com/u/25802689?v=3","gravatar_id":"","url":"https://api.github.com/users/cyrilmesvayn","html_url":"https://github.com/cyrilmesvayn","followers_url":"https://api.github.com/users/cyrilmesvayn/followers","following_url":"https://api.github.com/users/cyrilmesvayn/following{/other_user}","gists_url":"https://api.github.com/users/cyrilmesvayn/gists{/gist_id}","starred_url":"https://api.github.com/users/cyrilmesvayn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyrilmesvayn/subscriptions","organizations_url":"https://api.github.com/users/cyrilmesvayn/orgs","repos_url":"https://api.github.com/users/cyrilmesvayn/repos","events_url":"https://api.github.com/users/cyrilmesvayn/events{/privacy}","received_events_url":"https://api.github.com/users/cyrilmesvayn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-02-15T20:01:05Z","updated_at":"2017-04-07T14:26:23Z","closed_at":null,"body":"## Expected Behavior\r\nInput focus, TabIndex 1\r\n[Tab] Input focus, TabIndex 2\r\n[Tab] Input focus, TabIndex 3 {Opens our flatpickr plugin}\r\n[Click] Date, closes plugin\r\nOR\r\n[Enter] Selects date, closes plugin\r\n[Tab] Input focus, TabIndex 4\r\n\r\n## Current Behavior\r\nInput focus, TabIndex 1\r\n[Tab] Input focus, TabIndex 2\r\n[Tab] Input focus, TabIndex 3 {Opens our flatpickr plugin}\r\n[Tab] flatpickr first day of currently selected month is selected\r\n[Tab] flatpickr second day of currently selected month is selected\r\n[...]\r\n[Tab] flatpickr last day of currently selected month is selected\r\n[Tab] Does nothing more\r\n\r\nAlternate :\r\nInput focus, TabIndex 1\r\n[Tab] Input focus, TabIndex 2\r\n[Tab] Input focus, TabIndex 3 {Opens our flatpickr plugin}\r\n[Click] Date, closes plugin\r\n[Tab] Resets TabIndex to first Input (TabIndex 1)\r\n\r\n## Steps to Reproduce (for bugs)\r\nsee [jsFiddle](https://jsfiddle.net/dqt5k7qo/2/)\r\nI've fumbled the \"natural\" TabIndex order to show more easily expectations VS current behavior.\r\n\r\n## Additional Questions\r\nIs this working as intended? Is there a way to set this up in an alternate way, with an option? Optional behavior that could be added, on Tab, selects current date if nothing is selected and moves on to the next input.\r\n\r\nTested with both the Date and Time picker variants.\r\n\r\nFirst time reporting an issue, thanks for the support and the great plugin otherwise :+1: "},"comment":{"url":"https://api.github.com/repos/chmln/flatpickr/issues/comments/292551270","html_url":"https://github.com/chmln/flatpickr/issues/623#issuecomment-292551270","issue_url":"https://api.github.com/repos/chmln/flatpickr/issues/623","id":292551270,"user":{"login":"Seldaek","id":183678,"avatar_url":"https://avatars2.githubusercontent.com/u/183678?v=3","gravatar_id":"","url":"https://api.github.com/users/Seldaek","html_url":"https://github.com/Seldaek","followers_url":"https://api.github.com/users/Seldaek/followers","following_url":"https://api.github.com/users/Seldaek/following{/other_user}","gists_url":"https://api.github.com/users/Seldaek/gists{/gist_id}","starred_url":"https://api.github.com/users/Seldaek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Seldaek/subscriptions","organizations_url":"https://api.github.com/users/Seldaek/orgs","repos_url":"https://api.github.com/users/Seldaek/repos","events_url":"https://api.github.com/users/Seldaek/events{/privacy}","received_events_url":"https://api.github.com/users/Seldaek/received_events","type":"User","site_admin":false},"created_at":"2017-04-07T14:26:23Z","updated_at":"2017-04-07T14:26:23Z","body":"@chmln actually the keyboard navigation stuff is causing a bunch of issues for us, as it interferes with the rest of the application, especially in the inline calendar we have which is changing month/year at random while you use arrow keys in other places of the application. IMO this should only happen while you are either focused in the input field linked to that respective flatpickr instance, or within one of the flatpickr's input fields like the year field. Acting on any keydown event happening anywhere in the window means you are not playing well with the environment.\r\n\r\nI think ideally it should react only when the right input fields are the target, but also having an option to disable the onKeyDown event listeners entirely would be good I guess. For example we like to allow people to type dates in a smart way in the input field, but with the last version of flatpickr when you press left/right you can't move the cursor in the input field anymore, it's just changing months on you and losing the focus from the input field.\r\n\r\nThanks for all the work on this though :)"}}
{"actor":{"display_login":"Seldaek"}}