taye / taye/interact.js

Draggable iframe stops almost immediately on iOS

Open
#951 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
12.9k
Forks
804
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified. Start by reproducing the provided HTML, JavaScript, and CSS on iOS and Android, then compare the drag behavior and trace the touch-drag entry point. Done means the iframe wrapper continues dragging on iOS as it does on Android.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.