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

[BUG] Absolute dragmode does not work on touch devices #2419

Closed
MartinPutz opened this issue Nov 20, 2019 · 4 comments
Closed

[BUG] Absolute dragmode does not work on touch devices #2419

MartinPutz opened this issue Nov 20, 2019 · 4 comments

Comments

@MartinPutz
Copy link

Absolute dragmode (with grapesjs touch plugin) does not work on touch devices.
GrapesJS version:0.15.8

Expected behavior:
The user should be able to move components using drag and drop on touch screens as well.

Current behavior:
The user can drag and drop a block just fine.
If the user wants to move the dropped component by dragging, it looks like the drag is started(style changed) but the component does not move.

It can be reproduced in the demo as well:
https://jsfiddle.net/v9kecdpz/

Steps to reproduce:

  1. Open the demo (included jsfiddle with grapesjs touch plugin)
  2. Drag a block into the canvas(or use an existing one)
  3. Try to move the component by dragging

Tested on:
Android Tablet
Ipad 2019, IOS 13

Chrome browser was used for testing.

It is most likely not a device/OS specific issue. I am suspecting missing touch events.

@pradeeshattlee
Copy link

Hey @MartinPutz
The asset manager doesn't pop up on the iPad, desktop on touch devices- chrome, firefox, and safari.

And the editor canvas scroll doesn't work on the iPhone.

What am I missing?

Thanks in advance.

@MartinPutz
Copy link
Author

Hey @pradeeshattlee

This issue is not really related to the asset manager, but moving the components around, once they are rendered.

I rarely use the asset manager, but as I recall it was working just fine on iPad as well.
If I were you I would open a new issue with all the details that might be useful.

@wfcheng
Copy link

wfcheng commented Jan 9, 2021

This may or may not be related. I noticed with grapejs v0.16.34 on OSX Safari, the event argument inside onStart() function in src/commands/view/ComponentDrag.js is undefined when I drag a block onto the canvas, which can be reproduced with the same fiddle cited above https://jsfiddle.net/v9kecdpz/, again on Safari.

I had to patch it locally as below instead (not the prettiest but it seems to work):

from const { x, y } = Canvas.getMouseRelativeCanvas(event);
to const { x, y } = Canvas.getMouseRelativeCanvas(event || opts.event);

@artf
Copy link
Member

artf commented Oct 16, 2021

I close this issue as I'm planning to solve all ones related to absolute positioning here: #3770

@artf artf closed this as completed Oct 16, 2021
@GrapesJS GrapesJS locked and limited conversation to collaborators Oct 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants