New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard controls for buttons propagate causing double behavior #1452
Comments
Is there a reason the 'onKeyPress' function binds on the 'keyup' event (line 68 of Button.js)? By then, it's too late to prevent the default behavior of moving the page. If you change it to bind on 'keydown' it will prevent the default behavior in time (in Chrome at least). I don't know if this will work in all browsers. |
Hmm, that could be the way to fix it. I can't think of any reason why it needs to be on keyup, except that it's more the completion of the action like click. But the browser doesn't wait for keyup to jump the page so I guess that's what we have to do either way. Good find, thanks! Would you want to create a PR for that? |
Binding during keydown will be more effective at preventing certain default behavior like moving the page down as these events may happen prior to keyup. Addresses videojs#1452
+1. |
#1455 should have taken care of this one. |
The spacebar and enter key can be used to trigger a button, based on accessibility guidelines. We do preventDefault on those events, but they're still apparently bubbling up to the browser.
This may relate to #1446.
The player will start playing and also the page will jump down, like the normal space bar operation.
The event should have been prevented from reaching the browser so the pages doesn't jump down.
4.7
Mac, Safari and Chrome
The text was updated successfully, but these errors were encountered: