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

Body can scroll horizontally on Android #238

Open
kench928 opened this issue Oct 22, 2014 · 7 comments
Open

Body can scroll horizontally on Android #238

kench928 opened this issue Oct 22, 2014 · 7 comments

Comments

@kench928
Copy link

Environment: Android 4.4.4 / Sony Xperia Z

After opening the mobile menu, you can touch on the underneath menu area and scroll horizontally (like what you see on the attchment [screenshot_2014-10-22-23-56-35]).
And then after you close it, the whole screen moved left and not in the correct position (like attchement [screenshot_2014-10-23-01-27-31]).

I can't find any solution and colud someone figure it out how to fix it?
Thanks a lot.

screenshot_2014-10-22-23-56-35

screenshot_2014-10-23-01-27-31

@kench928
Copy link
Author

To supplement:
I have same problem on Android Chrome 38.0.2125.102 and Android Firefox 33.0.

@brutto
Copy link

brutto commented Oct 30, 2014

Confirm that bug. Its not only Android issue, but can be repeatable on decktop with touchscreen with Chrome 38+ 8( You can repeat this behaviour on expample page just open left-side menu and than touch menu in any point and swipe it to right... =\

@HalloTobi
Copy link

We're encountering a similar behaviour on iOS 7+8, too. 😢

@devben
Copy link

devben commented Nov 13, 2014

I was also experiencing this and the following css appears to have resolved the issue

.snapjs-right,
.snapjs-left {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
}

@ashishsajwan
Copy link

👍

ashishsajwan pushed a commit to ashishsajwan/Snap.js that referenced this issue Jan 23, 2015
@Ninos
Copy link

Ninos commented Jun 19, 2015

Think @devben's solution is not really good. If you scroll down then acticate the menu, the body content jumps to top again. I solved it with following js-snippet:

this.snapper.on('animated', function() {
    if( jQuery('body').hasClass('snapjs-left') || jQuery('body').hasClass('snapjs-right') ) {
        jQuery('body').css({
            position: 'fixed',
            top: jQuery(window).scrollTop() * -1
        });
    }
    else if( jQuery('body').css('position') == 'fixed' ) {
        var top = parseFloat( jQuery('body').css('top') ) * -1;
            jQuery('body').css({
            position: '',
            top: 0
        });

        if( top != 0 ) {
            jQuery(window).scrollTop( top );
        }
    }
});

The only problem here is, that on android the page seems to get rendered again, so you have a blank page for some ms (1-10ms). Not very nice, but better than the other solution.

If someone has a better idea, just let me know :P

@alexiovay
Copy link

Any new solution to this?

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

7 participants