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

Issue resolving touch points for nested iframes #3

Open
RichardALeon opened this issue Sep 11, 2020 · 0 comments
Open

Issue resolving touch points for nested iframes #3

RichardALeon opened this issue Sep 11, 2020 · 0 comments

Comments

@RichardALeon
Copy link

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:
GrapesJS/grapesjs#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?

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

No branches or pull requests

1 participant