Skip to content
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

Cannot use the keyboard to "click" on the toolbar buttons when Page Fit is used #17071

Closed
calixteman opened this issue Oct 4, 2023 · 2 comments · Fixed by #17074
Closed

Cannot use the keyboard to "click" on the toolbar buttons when Page Fit is used #17071

calixteman opened this issue Oct 4, 2023 · 2 comments · Fixed by #17074
Labels

Comments

@calixteman
Copy link
Contributor

This bug is so weird that I wonder if I'm doing something wrong...
That said here's a STR:

  • open a pdf and set Page Fit;
  • with the keyboard, move the focus on a toolbar button, e.g. the freetext one;
  • press Enter key

nothing is happening.
If I change to Automatic Zoom then everything is ok.

@calixteman
Copy link
Contributor Author

We should add a specific case when Enter is pressed and the activeElement is a button, link, ...

pdf.js/web/app.js

Line 2960 in 40d6b0e

function webViewerKeyDown(evt) {

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Oct 4, 2023

I've not tested it, but maybe changing

pdf.js/web/app.js

Line 3254 in 40d6b0e

(evt.keyCode === 32 && curElementTagName !== "BUTTON")

into something like the following might work?

((evt.keyCode === 13 || evt.keyCode === 32) && curElementTagName !== "BUTTON") 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants