question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Dialog] Scrolling touchable content does not work on Safari Mobile

See original GitHub issue

Problem Description

I’m having a scrollabale (don’t think that it matters) page with an overlaying Dialog. The Dialog contains a List, which is also scrollable. The List element contains ListItems and Dividers. When I try to scroll the list, the item on which my finger is placed, is marked gray (selected). When moving the finger, the list does not scroll but the rest of the page, which is overlayed by the dialog, is pulled down. As you can see on the print screen, the page is pulled down like it can be done for refreshing. The annoying thing is, that sometimes it works as intended but most times the overlayed content is pulled down (don’t know what the reason therefore is).

file_000

~~Possible solution? http://www.two-legs.com/2012/07/html5-native-scrolling-on-iphone-ios5/~~

Update: Looks like the list causes the problem. There is no problem when rendering only plain text in the dialog body.

Update 2: The problem might be caused by onTouchTap of the ListItems. When using inactive content (i.e. removing onTouchTap or disabling it using the property disabled: true), scrolling works just fine.

Versions

  • Material-UI: 0.14.4, 0.15.0-alpha.2
  • React: 0.14.7
  • Browser: Safari 9 on iOS 9.2 (iPad mini); problem does not appear on Android and desktop devices

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
RichardLindhoutcommented, Sep 5, 2017

Fast fix

const styles = theme => {
  return {
    smoothList: {
      overflowScrolling: 'touch',
      WebkitOverflowScrolling: 'touch',
    }
}

   <List className={this.props.classes.smoothList}>
1reaction
Taakncommented, Jun 6, 2016

When the dialog pops up, it sets the background to overflow: hidden. However that’s not enough and it should set background to fixed. Something like this fixed it for me in render:

    var html = document.getElementsByTagName("html")[0];
    if (this.props.open==true) {
      html.style.position = 'fixed';
    } else {
      html.style.position = 'static';
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Dialog] Scrolling touchable content does not work on Safari ...
Problem Description I'm having a scrollabale (don't think that it matters) page with an overlaying Dialog. The Dialog contains a List, ...
Read more >
Material-ui v0 Safari iOS dialog content scroll - Stack Overflow
To make the Dialog content scroll normally on iOS, you have to add -webkit-overflow-scrolling: touch; to the CSS.
Read more >
How to fix popup's scrolling on Safari - DEV Community ‍ ‍
First Try: add webkit specific css​​ popup and body: overflow-y: scroll; -webkit-overflow-scrolling: touch; It doesn't work, the body is keep  ...
Read more >
IPad Scroll Issues with Fixed Content - Rick Strahl's Web Log
I've run into problems with scrolling <div> tags with iOS Safari on ... div to scroll you have to use the –webkit-overflow-scrolling: touch...
Read more >
Opened Lightbox with many Content isn't scrollable on iOS ...
Hello, I used the lightbox to show a list of data when the user is clicking on a information button. Everything is working...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found