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

[Editor] Don't steal the keyboard events when editing mode is enabled #17204

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

calixteman
Copy link
Contributor

No description provided.

@calixteman calixteman added this to In progress in PDF.js editing via automation Oct 29, 2023
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry to say that I'm not a fan of having to sprinkle event-handlers throughout the viewer code-base, since it really doesn't feel like a very maintainable solution.

Can't we handle this at the Editor-level instead, e.g. by checking that the active element is within the page and/or viewer?

web/pdf_find_bar.js Outdated Show resolved Hide resolved
@calixteman
Copy link
Contributor Author

I'm sorry to say that I'm not a fan of having to sprinkle event-handlers throughout the viewer code-base, since it really doesn't feel like a very maintainable solution.

Can't we handle this at the Editor-level instead, e.g. by checking that the active element is within the page and/or viewer?

To be honest, my feeling is that nothing is exciting here. If in 6 months we've to add an element in the UI which can be controlled with the keyboard, we've to remember that it can badly interact with the editing mode, even if it's unrelated.
In an ideal world, events should have a flag which would be true when they've been consumed during the bubbling phase...
That said, it isn't that simple: for example if you click on a slider on then press ctrl+Z, the active element is the slider but.
So we've to take of the type of the active element and when it's an input we've to take care of the type of input (a slider isn't the same as a text input) so it leads to more complexity.
That said, your inline comment is the best argument to say that this patch is not doing the right thing: I'll fix that.

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, thank you!

@calixteman
Copy link
Contributor Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/cfb72308491df92/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/019660720d9d4e9/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/019660720d9d4e9/output.txt

Total script time: 5.68 mins

  • Integration Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/cfb72308491df92/output.txt

Total script time: 19.20 mins

  • Integration Tests: Passed

@calixteman
Copy link
Contributor Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/e05bf72a7deded8/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/8e27b554b171c5e/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/e05bf72a7deded8/output.txt

Total script time: 2.36 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/8e27b554b171c5e/output.txt

Total script time: 8.57 mins

  • Integration Tests: Passed

@calixteman
Copy link
Contributor Author

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/06fa5fecd7669cd/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/f48a64df1c9b38a/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/06fa5fecd7669cd/output.txt

Total script time: 5.49 mins

  • Integration Tests: FAILED

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/f48a64df1c9b38a/output.txt

Total script time: 14.97 mins

  • Integration Tests: Passed

@calixteman calixteman merged commit 50c0fcc into mozilla:master Oct 30, 2023
3 checks passed
PDF.js editing automation moved this from In progress to Done Oct 30, 2023
@calixteman calixteman deleted the issue17167 branch October 30, 2023 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Global 'keydown' event listener for the AnnotationEditorUIManager hijacks keystrokes.
3 participants