Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jun 2010
    Posts
    64
    Vote Rating
    0
    jeroenvduffelen is on a distinguished road

      0  

    Default [FIXED-360] scroller.scrollTo doesn't fire scroll event

    [FIXED-360] scroller.scrollTo doesn't fire scroll event


    panel.scroller.scrollTo({x: 0, y: scrollToPosY}, 360, 'cubic-bezier(0.4, .75, 0.5, .95)');

    When I scroll the panel manually (with touch), the scroller fires the scroll event constantly. But when I scroll the panel with the above instruction it doesn't.

    (sencha touch 0.95)

  2. #2
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    Thanks for the bug report.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    This is because css transitions don't fire events during the animation. We won't be able to easily provide these. Is there any particular use case that you need these scroll events for during a scrollTo animation?

  4. #4
    Sencha User
    Join Date
    Jun 2010
    Posts
    64
    Vote Rating
    0
    jeroenvduffelen is on a distinguished road

      0  

    Default


    Hmmm.. but the scroll event does fire when the scroll animation / transition is triggered by touchscreen input. So when I swipe my finger over the screen and I let go, the scroll event keeps firing with the exact position of the scrollEl until the transition has ended.

    I'm using the position quite a lot because I am keeping track of the progress of the scroller to check if some other event should be fired.


    So when i do

    Code:
    this.scroller.on('scroll', this.onScroll, this)
    
    onScroll: function(){
      console.log(this.scroller.getOffset().y);
    }
    I get all the positions the scroller passes... except when i scroll with .scrollTo.

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    Thats because when you release your finger, we determine momentum and apply velocity. The resulting momentum is handled purely by us, using intervals, and thus we can fire events. When you use scrollTo we just use a css transition. We tried doing the scrollTo animation using our custom javascript animation, but that would require us to determine the velocity required to get exactly to that position you are trying to get to. This is not such a big deal, but it was rather inprecise since sometimes it would two pixels too far etc. You could try playing around with applyVelocity function of scroller. I will look if we can somehow change this on our end, but that is something maybe for 1.1

  6. #6
    Sencha User
    Join Date
    Jun 2010
    Posts
    64
    Vote Rating
    0
    jeroenvduffelen is on a distinguished road

      0  

    Default


    Ah, clear explanation. I've build a simple work around for my progress checker so I don't need it at the moment but would be cool to have it in a later version!

  7. #7
    Sencha - Support Team yuki's Avatar
    Join Date
    Jun 2007
    Location
    Chigasaki, Japan
    Posts
    273
    Vote Rating
    0
    yuki is on a distinguished road

      0  

    Default


    Hi Tommy,

    Quote Originally Posted by TommyMaintz View Post
    This is because css transitions don't fire events during the animation. We won't be able to easily provide these. Is there any particular use case that you need these scroll events for during a scrollTo animation?
    When I use scrollTo for Ext.List's scroller, if grouped is true, the indexBar remains unchanged until I scroll it with the finger (sample code here. Scroll down to the bottom, and then click "top" button. indexBar "M" stays). This is because List needs "scroll" event from scroller to check the closest indexBar.
    Ext Japan, LLC [Twitter: @extjapan]
    [Ext JS / Ext GWTのライセンス販売][日本語テクニカルサポート][Ext JSトレーニング・コンサルティング]

  8. #8
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    This seems to have been fixed in 1.0. Please let us know if this issue still exists for you and we will reinvestigate. Marking this bug as fixed for now.

Similar Threads

  1. [FIXED-515] Component doesn't destroy its Scroller
    By elishnevsky in forum Sencha Touch 1.x: Bugs
    Replies: 3
    Last Post: 4 Nov 2010, 8:23 PM
  2. [FIXED-170] SpinnerField change event doesn't fire
    By djMaxM in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 15 Aug 2010, 2:13 AM
  3. Replies: 1
    Last Post: 25 May 2010, 12:06 AM
  4. [FIXED-652] groupmousedown event doesn't fire
    By LambyPie in forum Ext 3.x: Bugs
    Replies: 1
    Last Post: 5 Apr 2010, 8:34 AM
  5. How to scroll to a Grid's row (focusRow, scrollTo doesn't work)
    By maya in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 7 Oct 2007, 5:18 AM

Thread Participants: 3