GrapesJS / GrapesJS/touch

Issue resolving touch points for nested iframes

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
19
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Hello there,

I recently started integrating grapesjs into a web application that I work on. In order to support mobile devices, I added the touch plugin.

I am noticing that when I have the editor nested in a specific location within the document, touch events are not propagated to the correct component within the iframe. This seems to stem from the getTarget function of DragDropTouch, where the iframe's absolute offset within the document is subtracted from the coordinates of the event.

My testing demonstrates that instead of calculating and using the iframe's offset within the document, its offset from the viewport should instead be used (via `el.getBoundingClientRect`)

Somebody had posted an issue in the main grapesjs repository with similar effects to what I am experiencing, but they closed it themselves without explaining if they found a different solution:
https://github.com/artf/grapesjs/issues/1571

I do not observe these problems when using the live demo for the newsletter editor.

My question is: Is my assumption correct that the plugin should be calculating offset in terms of viewport, or have I made an error on my own part when setting up the editor?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.