iNoBounce icon indicating copy to clipboard operation
iNoBounce copied to clipboard

Height should take into account padding-top and padding-bottom

Open francescom opened this issue 8 years ago • 6 comments

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)

francescom avatar Mar 07 '16 16:03 francescom

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.

lazd avatar Mar 07 '16 16:03 lazd

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.

francescom avatar Mar 07 '16 16:03 francescom

Please just provide a file examples/padding.html that reproduces the issue with this pull request, no need to modify your site! Thanks!

lazd avatar Mar 07 '16 16:03 lazd

Site is already modified and is in test/staging area, no problem.

francescom avatar Mar 07 '16 16:03 francescom

I have added style="padding:64px" to the app.html example.

padding.html.zip

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".

francescom avatar Mar 07 '16 16:03 francescom

Added a screenshot screenshot

francescom avatar Mar 07 '16 17:03 francescom