You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've started using ScrollViewPaginator for a project and I noticed this problem on horizontal scroll views with the paginator. To see it happening, just open the offical demo page (http://yuilibrary.com/yui/docs/scrollview/scrollview-paging-example.html) and make a diagonal drag (from top right to bottom left). You'll see that the scrollbar will move to the next image but the image showing up will still be the one that was showing before the drag.
I've investigated a little and I believe that the problem is inside paginator-plugin.js's _beforeHostFlick method. It prevents calls to _flick but simulates them on the background, moving to the next/previous index and calling scrollTo in the end. The diagonal drag is being identified by scrollview-base.js as a flick on the y axis though, which would normally be ignored inside the _flick method if it was not being prevented and simulated by the paginator. The _beforeHostFlick method doesn't check if the gesture's axis matches the allowed flick axis though, and simulates it anyway, moving to the next index but without scrolling to it since the gesture didn't cause a scroll on the x axis.
I've verified that this is fixed by just checking if the gesture axis is the same as the flick axis inside _beforeHostFlick, but I'm not sure if that's the best fix. Maybe a diagonal drag should also be considered as a horizontal flick instead of just vertical. I can organize what I have and send it later when I have some time if this isn't fixed by then though.
The text was updated successfully, but these errors were encountered:
This is fixing the issue described in yui#1816, which causes diagonal flicks to change the paginator's index even though the image showing up is not updated.
To fix this I'm just adding one more check to _beforeHostFlick to ignore flicks that don't happen in the specified flick axis. This is the default behavior of scrollview-base, but paginator-plugin prevents it and runs its own code, so we need the check there as well.
mairatma
added a commit
to mairatma/yui3
that referenced
this issue
May 16, 2014
This is fixing the issue described in yui#1816, which causes diagonal flicks to change the paginator's index even though the image showing up is not updated.
To fix this I'm just adding one more check to _beforeHostFlick to ignore flicks that don't happen in the specified flick axis. This is the default behavior of scrollview-base, but paginator-plugin prevents it and runs its own code, so we need the check there as well.
I've started using ScrollViewPaginator for a project and I noticed this problem on horizontal scroll views with the paginator. To see it happening, just open the offical demo page (http://yuilibrary.com/yui/docs/scrollview/scrollview-paging-example.html) and make a diagonal drag (from top right to bottom left). You'll see that the scrollbar will move to the next image but the image showing up will still be the one that was showing before the drag.
I've investigated a little and I believe that the problem is inside paginator-plugin.js's _beforeHostFlick method. It prevents calls to _flick but simulates them on the background, moving to the next/previous index and calling scrollTo in the end. The diagonal drag is being identified by scrollview-base.js as a flick on the y axis though, which would normally be ignored inside the _flick method if it was not being prevented and simulated by the paginator. The _beforeHostFlick method doesn't check if the gesture's axis matches the allowed flick axis though, and simulates it anyway, moving to the next index but without scrolling to it since the gesture didn't cause a scroll on the x axis.
I've verified that this is fixed by just checking if the gesture axis is the same as the flick axis inside _beforeHostFlick, but I'm not sure if that's the best fix. Maybe a diagonal drag should also be considered as a horizontal flick instead of just vertical. I can organize what I have and send it later when I have some time if this isn't fixed by then though.
The text was updated successfully, but these errors were encountered: