-
Notifications
You must be signed in to change notification settings - Fork 400
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
iOS 11.3: iNoBounce No Longer Works #45
Comments
I still don't have access to 11.3 to test, but it does work on iOS 11.2.6. Can anyone check, using remote debugger, if there is console output? |
There is no console output sadly |
My best guess is that this would be due to the changes in iOS 11.3 that effect the viewport to help with iPhone X styling. I have made the code output everything it is doing and it seems to be "working" according to plan on the backend however we still see it bounce. |
I think I succeeded in not getting my app to bounce, try https://educa.juegos/ |
@icarito yes! You got it to work as expected! Would you mind sharing how you did it? |
I tried a lot of stuff - I think the trick was to make html, and body have |
That was exactly the problem! I will write up a piece of code that will be attached to iNoBounce to attempt to fix this without user input! |
@icarito's solution seems to fix the issue for me too. |
Sounds like it's a CSS fix... Which we could apply in JavaScript conditionally based on the user agent, but could cause issues if people aren't expecting it... Should this be a footnote in the readme, or should it be code? |
The CSS fix here doesn't work very well if you try it out. The bounce actually still happens, you just can't see it. When you try to scroll past the top, and then immediately try to scroll down, you can't because you are still scrolling the entire page instead of just the container. It's a little difficult to explain but this makes for unexpected scrolling behaviour. |
Yes, I've noticed that you also get a little 20px bar at the bottom of the
screen for no apparent reason. At least on my end.
…On Sat, 31 Mar 2018 at 2:35 am, Terren ***@***.***> wrote:
The CSS fix here doesn't work very well if you try it out. The bounce
actually still happens, you just can't see it. When you try to scroll past
the top, and then immediately try to scroll down, you can't because you are
still scrolling the entire page instead of just the container. It's a
little difficult to explain but this makes for unexpected scrolling
behaviour.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#45 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Aj5diVkNDSYk3DJCNw_19wq3OE20AAqqks5tjlDbgaJpZM4RxqlD>
.
|
This could be related to a webkit issue that we found as a part of atlassian/react-beautiful-dnd#413 |
Changing in inobounce.js: window.addEventListener('touchstart', handleTouchstart, false);
window.addEventListener('touchmove', handleTouchmove, false); to window.addEventListener('touchstart', handleTouchstart, { passive : false });
window.addEventListener('touchmove', handleTouchmove, { passive : false }); Fixed the problem for me. That isn't supported in some browsers, so you need to check for it first. I've borrowed the check from Modernizr.passiveeventlisteners and have this at the top of inobounce.js: var supportsPassiveOption = false;
try {
var opts = Object.defineProperty({}, 'passive', {
get: function() {
supportsPassiveOption = true;
}
});
window.addEventListener('test', null, opts);
} catch (e) {} And then later have: window.addEventListener('touchstart', handleTouchstart, supportsPassiveOption ? { passive : false } : false);
window.addEventListener('touchmove', handleTouchmove, supportsPassiveOption ? { passive : false } : false); |
I feel we could probably add a check hardcoded so developers don't have to
use an external framework, they can just drop in. Otherwise, amazing job on
this fix!
…On Wed, 4 Apr 2018 at 1:57 am, Robert Schultz ***@***.***> wrote:
Changing:
window.addEventListener('touchstart', handleTouchstart, false);
window.addEventListener('touchmove', handleTouchmove, false);
to
window.addEventListener('touchstart', handleTouchstart, { passive : false
}); window.addEventListener('touchmove', handleTouchmove, { passive : false
});
Fixed the problem for me. I didn't submit a pull request because that
isn't supported in some browsers, so I'm actually doing a check like this Modernizr.passiveeventlisteners
? { passive : false } : false
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#45 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/Aj5diRc7GWL8NVN4sN4zftAnbxFfPdhtks5tk5vQgaJpZM4RxqlD>
.
|
@Sembiance I can confirm that this fixed the issue, thank you so much! |
I can confirm this works in iOS 11.3 and iOS 11.4 Beta 1! |
Pull request made @lazd & @Sembiance #47 |
Fix released in 0.1.6. Thanks everyone! |
Steps:
Expected:
Observed:
Device:
The text was updated successfully, but these errors were encountered: