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] Replace mouse events by pointer ones (bug 1779015) #15188

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

calixteman
Copy link
Contributor

The goal is to be able to edit a pdf on a touchscreen.

@calixteman
Copy link
Contributor Author

If you want to test drag and drop in firefox, you must double tap on an element and then quickly start dragging it.

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, assuming that you've carefully tested that it doesn't break the "normal" case (i.e. using a mouse).

@@ -224,7 +224,7 @@ class AnnotationEditor {
this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360);
this.div.className = this.name;
this.div.setAttribute("id", this.id);
this.div.tabIndex = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure why this was changed, since there ought to be no practical difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't explain why.
I tested the patch on laptop with a touch screen and it was almost impossible to create a text editor in just tapping on the screen.
My feeling was that the div stole the focus from the nested editorDiv and then removed the editor.
So I just removed the tabindex and magically it worked.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So I just removed the tabindex and magically it worked.

But it's still being set, but slightly differently now; hence my question :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I thought it was just a removal in taking into account the context gh gives me here, and I was finally talking about this removal:
https://github.com/mozilla/pdf.js/pull/15188/files/b408d0e0abfd7d8c98e2befc82a7d4027e5d84e0#diff-8545c7e2bc39439352001789060a1bb9a42fc64e599c34322be45102ae3e7d08L221

Anyway you're right the change here is useless, but if iirc it was to be consistent with the line just above.
And I'm not sure the setAttribute on the above line is useful either.

The goal is to be able to edit a pdf on a touchscreen.
@calixteman
Copy link
Contributor Author

/botio integrationtest

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://54.193.163.58:8877/17637ef23d3ce39/output.txt

@pdfjsbot
Copy link

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/311916f28e2efc3/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/311916f28e2efc3/output.txt

Total script time: 4.69 mins

  • Integration Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/17637ef23d3ce39/output.txt

Total script time: 6.71 mins

  • Integration Tests: FAILED

@calixteman
Copy link
Contributor Author

The multi-selection stuff is not working on touch screens because the event order is not exactly the same.
I'll fix in a follow-up.

@calixteman calixteman merged commit 71db08a into mozilla:master Jul 22, 2022
@calixteman calixteman deleted the touch branch July 22, 2022 12:14
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 this pull request may close these issues.

3 participants