iNoBounce
iNoBounce copied to clipboard
Height should take into account padding-top and padding-bottom
When detecting if element is at bottom, the height should take into account padding-top and padding-bottom, otherwise it won't work, and the page will "bounce" when you drag elements with padding (when they are at the bottom scroll position)
Nice find! Can you include an example of this failing so I can test it against the new code and old code? Unfortunately we don't have automated tests in iNoBounce, so we need to poke at it and make sure it does what we expect it to, so examples help.
Yes, I can revert the code already patched to the previous state for some time (but not for long).
You can test here:
http://arslan.it/test2/?c=1
Drag the text up till it reaches the end. Then drag again and it will catch the whole page and overscroll (bounce).
While if you change the link to the script from
<script type="text/javascript" src="bower_components/inobounce/inobounce.min.js"></script>
to
<script type="text/javascript" src="bower_components/inobounce/inobounce.js"></script>
(use the patched, non minified, version)
it will stop bouncing the page.
Please just provide a file examples/padding.html
that reproduces the issue with this pull request, no need to modify your site! Thanks!
Site is already modified and is in test/staging area, no problem.
I have added style="padding:64px" to the app.html example.
If you drag up to the last line, then leave it. Then drag up again, it will bounce the page.
To notice it, you have to look at the top bar. The top bar will get out of the page when you drag, that's the only difference between a correct drag and a full page "bounce".
Added a screenshot