gridview:selectNextRow() always scrolls and animates regardless of parameter values

Hey Panic,

The way default parameters are handled for the following gridview methods is incorrect, leading to the two optional parameters scrollToSelection and animate always being set to true.

The methods are:

gridview:selectNextRow(wrapSelection, scrollToSelection, animate)
gridview:selectPreviousRow(wrapSelection, scrollToSelection, animate)
gridview:selectNextColumn(wrapSelection, scrollToSelection, animate)
gridview:selectPreviousColumn(wrapSelection, scrollToSelection, animate)

And the problematic code which they all share is:

local scroll = scrollToSelection or true
local animate = animate or true

I found this because I prefer not to animate large grid views (drawing grids with many items every frame can tank the frame rate). Instead I only update the gridview image once each time a new selection occurs. Since the scroll positions were easing into their values rather than updating immediately, the grid view appeared to not be scrolling after updating the image once.

If anyone else has this problem, a temporary work-around is to clone the gridview.lua class and import a fixed local copy, setting the default parameters like so: if animate == nil then animate = true end

1 Like

Hi! Sorry for the lack of reply until now. It looks like this bug was fixed a while back. If you're still seeing this issue please let me know because that would be something strange is going on.