-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
fix: disable contextmenu on non-secondary pen
events or touch
#4675
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/excalidraw/excalidraw/8Vk82LVYW4vfqSUhW1KXe1KCwP25 |
This is a good improvement. I tested it on iPad with pencil and touch and on Samsung Note with touch and S-Pen. Works as expected. Not related to this change... but do you have any idea why the context menu won't on a long press with the apple pencil, but does show with a long press with the S-Pen. This difference is the same for both the current excalidraw.com version and this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this?
event.nativeEvent.pointerType === "pen" &&
event.button !== POINTER_BUTTON.SECONDARY
Good catch. AFAIK iOS doesn't support touch-hold to open contextMenu, so we're detecting it manually. We should include pens in that. |
Allow opening contextmenu via the pen button that usually is used for opening contextmenus (it usually emits the same I'll add a doc. |
this fix will require more work because of how it's implemented. I'll remove the commit for now as it actually needs timeout clearing which I'm not doing for pen. I'll open a new PR for this fix later. |
This reverts commit 50a67cc.
@zsviczian merging? |
fix #4674