Read more

Solved: Element inside overflow:scroll container cannot be scrolled on iOS when dragged by a contained iframe

Dominik Schöler
April 28, 2017Software engineer at makandra GmbH

Imagine the following HTML structure, where the scrolling container has overflow-y: scroll:

+--scrolling container+-+
|                       |
| +-child element+----+ |
| | ++iframe++        | |
| | |        |        | |
| | |        |        | |
+-----------------------+
  | |        |        |   <-- actually cut off by
  | +--------+        |   <-- scrolling container
  +-------------------+
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

The issue: On iOS, the child element cannot be scrolled when grabbing the iframe (i.e. putting your finger somewhere on the iframe).

Solution

You need to add -webkit-overflow-scroll: touch on the element that has overflow:scroll, i.e. the scrolling container. This activates "momentum scrolling" for this container, but also fixes the iframe scrolling issue.

Posted by Dominik Schöler to makandra dev (2017-04-28 16:07)