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

Not working anymore? iOS 11.3 (Safari, Chrome, Firefox) #4

Open
alvarotrigo opened this issue Apr 19, 2018 · 5 comments
Open

Not working anymore? iOS 11.3 (Safari, Chrome, Firefox) #4

alvarotrigo opened this issue Apr 19, 2018 · 5 comments

Comments

@alvarotrigo
Copy link
Contributor

It doesn't seem to be working anymore?
I tried it in iOS 11.3 on Safari, Chrome and Firefox. All of them have the error. The bouncing takes place.

I noticed it today. Is this something perhaps that has to do with the last iOS update?

@alvarotrigo
Copy link
Contributor Author

alvarotrigo commented Apr 19, 2018

Way to reproduce it:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Test</title>
    <meta name="Resource-type" content="Document" />

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>


    <script type="text/javascript">
    $(document).ready(function() {
        $('body').on('touchmove', preventBouncing);

        function preventBouncing(event){
            var e = event.originalEvent;
            console.log("preventing....");
            //preventing the easing on iOS devices
            event.preventDefault();
        }
    });
    </script>

    <style>
        body,html{
            overflow: hidden;
            height: 100%;
            margin: 0;
        }
        .demo{
            width: 100%;
            height: 100%;
            background: blue;
        }
    </style>
</head>
<body>

<div class="demo">
</div>

</body>
</html>

@alvarotrigo
Copy link
Contributor Author

Also in the index.html page you provide on the repo.

@yddmgirl
Copy link

You can add {passive: false} , try like this:

document.body.addEventListener('touchmove', function(evt) {
  //In this case, the default behavior is scrolling the body, which
  //would result in an overflow.  Since we don't want that, we preventDefault.
  if(!evt._isScroller) {
    evt.preventDefault()
  }
},{passive: false})

@alvarotrigo
Copy link
Contributor Author

Yeah I noticed that afterwards.
It would be nice to see this project modified. I've just added a pull request.

@alexharris
Copy link

this issue can be closed?

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

3 participants