ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Scroll methods conflicts with user scroll gestures (edited)

Open thomas1511 opened this issue 10 years ago • 4 comments

Short description of the problem:

If a user scrolls(and releases the screen so the scroll slows down), and the method: "scrollToBottom / scrollToTop" gets called. the screen will flicker(the original gesture conflicts with the scrollToBottom()) . I made an example, buts it's only on IOS

What behavior are you expecting?

The current scroll action should end, and only the scrollToBottom action should scroll.

Steps to reproduce:

  1. I made a simple plnkr example; but it's only visible in ios: http://plnkr.co/edit/VXSsuiuShhbqTNMksSzo?p=preview
  2. Scroll, (release), and while the scroll slows down, press the scrolldown buttun (chat icon)
  3. you'll see that the current event will try to finish over the scrollToBottom method

Which Ionic Version? 1.x or 2.x ionic2 beta.9 / beta.10

Plunker that shows an example of your issue

(old example) http://plnkr.co/edit/VXSsuiuShhbqTNMksSzo?p=preview (new example) I created a blank ionic project, and created a github repo: https://github.com/thomas1511/ionicScrollProblem

Code which conflicts:

this.content.scrollToBottom(300);

Edit: Added video to show problem

https://youtu.be/3gF1En3xdl0

thomas1511 avatar Jul 16 '16 08:07 thomas1511

I've created a video do demonstrate the problem:

https://youtu.be/3gF1En3xdl0

In the first case, the srolldown works as expected. In the second case, while scrolling, the scrolldown functionality does not.

thomas1511 avatar Jul 18 '16 12:07 thomas1511

If Anyone has the same problem. The following code fixed the problem for me.

this.content.getScrollElement().style.overflow = 'hidden'; this.content.scrollToBottom(); setTimeout( () => { this.content.getScrollElement().style.overflow = ''; }, 100);

Maybe it should be integrated in the scrollToBottom() functionality?

thomas1511 avatar Jul 20 '16 07:07 thomas1511

I've have also a problem with scrollToBottom only on ios. it doesnt work at all. i've created an example on a blank starter based. with nothing special only a scrollToBottom on Content.

https://github.com/bonoadil/blankDemo

NB : Easily reproducible and works fine in the browser & android.

@thomas1511 your fix doesnt work for me.

bonoadil avatar Mar 27 '17 21:03 bonoadil

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

ionitron-bot[bot] avatar Mar 27 '18 22:03 ionitron-bot[bot]