Right now Tab is disabled in Impress.js and just moves to the next slide. Even if I delete that code and let it behave normally and focus on links it kinda crashes impress.js Has anyone found a solution to this?
Thank you!
Right now Tab is disabled in Impress.js and just moves to the next slide. Even if I delete that code and let it behave normally and focus on links it kinda crashes impress.js Has anyone found a solution to this?
Thank you!
(I maintain a current fork of impress.js, as bartaz has not worked on it for years now, so I'm familiar with the keybindings code as well.)
The answer is that making Tab move to the next slide is the solution, not the problem :-)
More specifically, the problem is that in a browser, the tab key will jump to the "next" link or form field. If the link is outside the current slide, the browser will scroll to wherever the link is, completely breaking the presentation flow. So impress.js needs to disable the tab key.
Instead of disabling it, bartaz then just tied it to the next() function. If you don't want the Tab key to move to the next slide, you can of course remove that code, but you would still have to call event.preventDefault() to avoid the browser from receiving the Tab key.
In my fork of impress.js, I improved the support for using form fields, so that for example if the cursor is in a text input field, and you press left arrow, the presentation will not move to the next slide, rather it will move the cursor in your text field, as normal. But even in this case I've preserved the functionality of the Tab field: it will move to the next slide rather than next form field (or link).
It would be possible, but hard to try to figure out whether the next form field is still on the same slide or not, and then try to decide whether moving to that form field is the right thing to do.
UPDATE: This is the impress.js issue where Tab key is discussed.