Skip to content

Draggable iframe stops almost immediately on iOS #951

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

Open
sp1x opened this issue Feb 1, 2022 · 2 comments
Open

Draggable iframe stops almost immediately on iOS #951

sp1x opened this issue Feb 1, 2022 · 2 comments

Comments

@sp1x
Copy link

sp1x commented Feb 1, 2022

I'm trying to make iframe draggable using default code from docs.

HTML

<div class="iframe-wrap draggable">
  <iframe src="https://bbc.com" frameborder="0" ></iframe>
</div>

JS

const position = {x: 0, y: 0};
interact('.draggable').draggable({
  listeners: {
    move(event) {
      position.x += event.dx;
      position.y += event.dy;
      event.target.style.transform = `translate(${position.x}px, ${position.y}px)`;
    },
  }
});

CSS

.iframe-wrap {
  touch-action: none;
  user-select: none;
  width: 300px;
  height: 300px;
  overflow: hidden;
  position: fixed;
  z-index: 9;
}
.iframe-wrap iframe {
  pointer-events: none;
  height: 300px;
}

It works perfect on Android devices.
But on iOS dragging stops almost immediately.

@sp1x sp1x changed the title Draggable items stop after a few pixels on iOS Draggable iframe stops almost immediately on iOS Feb 1, 2022
@stale

This comment was marked as outdated.

@stale stale bot added the stale label Mar 2, 2022
@taye
Copy link
Owner

taye commented Apr 7, 2022

I'm planning on improving iframe support soon, but I can't give an estimated time, sorry.

If you don't need users to be able to click into the iframe, you can work around this by covering the iframe element with a transparent overlay.

@stale stale bot removed the stale label Apr 7, 2022
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

2 participants