Skip to content

Commit d425ae7

Browse files
authored
Bypass the call to transition when scrollToIndex time is 0
2 parents 9c1aed5 + d4f4129 commit d425ae7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

widgetLibrary/widget_tableview.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,8 +1644,14 @@ local function createTableView( tableView, options )
16441644
-- If there is a transition underway, cancel it first
16451645
if self._transitionToIndex then transition.cancel( self._transitionToIndex ) end
16461646
-- Transition the view
1647-
self._transitionToIndex = transition.to( self, { y = newPosition, time = scrollTime, transition = easing.outQuad, onComplete = executeOnComplete } )
1648-
1647+
if scrollTime > 0 then
1648+
self._transitionToIndex = transition.to( self, { y = newPosition, time = scrollTime, transition = easing.outQuad, onComplete = executeOnComplete } )
1649+
else
1650+
self.y = newPosition
1651+
if executeOnComplete then
1652+
executeOnComplete()
1653+
end
1654+
end
16491655
-- Update the last row index
16501656
self._lastRowIndex = rowIndex
16511657
end

0 commit comments

Comments
 (0)