Skip to content

Fixes #2038: Safari click and drag fix#2916

Closed
seabeeberry wants to merge 2 commits into
GraphiteEditor:masterfrom
seabeeberry:safari-click-and-drag-fix
Closed

Fixes #2038: Safari click and drag fix#2916
seabeeberry wants to merge 2 commits into
GraphiteEditor:masterfrom
seabeeberry:safari-click-and-drag-fix

Conversation

@seabeeberry
Copy link
Copy Markdown
Contributor

Closes #2038

For the last PR, I had put the target.requestPointerLock(); immediately inside the onDragPointerDown function which made dragging possible for Safari but crashed the possibility of text input within the number fields. The current solution I've found which both fixes the dragging issues for Safari and keeps the text input possibility the same as before is moving the target.requestPointerLock(); to the event handler definition onMove:

Image

This seems to work reliably on Safari, Firefox and Chrome.

Let me know if it needs any changes!

@seabeeberry seabeeberry changed the title Fixes #2038: Safari click and drag fix [WIP] Fixes #2038: Safari click and drag fix Jul 21, 2025
@seabeeberry seabeeberry changed the title [WIP] Fixes #2038: Safari click and drag fix Fixes #2038: Safari click and drag fix Jul 21, 2025
@Keavon Keavon force-pushed the safari-click-and-drag-fix branch from af3d4de to 94d10a6 Compare July 22, 2025 04:06
target.requestPointerLock();

beginDrag();
removeEventListener("pointermove", onMove);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't this now leaking the pointermove event now that we are sometimes early returning before this line? Seems like the target.requestPointerLock(); and beginDrag(); lines should be inside the if statement instead of the early return in its inverse.

@seabeeberry
Copy link
Copy Markdown
Contributor Author

After testing again, the "fixed" behavior in Safari is not working anymore, even when reverting to the initial commit. I have to close this PR as it does not solve the initial fix.

@Keavon
Copy link
Copy Markdown
Member

Keavon commented Jul 22, 2025

Weird:/ good luck continuing to investigate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Click-and-drag number fields can't be released in Safari

2 participants