Fixing Feathers Incorrect maxVerticalScrollPosition

Feathers is simply amazing. But like everything else, from time to time you need to implement a little work-around to get it to work properly.

Recently I was building a chat application that required the chat list to scroll to the bottom of the feed where the last message is displayed. In the case, because the list items (messages) are of all different lengths, I needed to set “hasVariableItemDimensions” to true. That in combination with a virtual layout leaves feathers virtually no clues in how long the list is actually going to be, therefore making maxVerticalScrollPosition not reliable.

The hack to make this work at this time, was found by Josh of course (Creator of Feathers) buried away in the forums. Essentially you need to continue to validate the list until it is truly complete. Snipped below.