Closed saiwong closed 7 years ago
Hm. What happens when the mobile device is rotated? Seems like it would break, because the window is actually having its size changed.
Removing repartition
calls is something worth working for, but I think the future of that is changing the internal data structure from a sorted array to a balanced binary tree, which will remove repartition
entirely.
The real issue that this is trying to fix is that for some odd reason that I haven't spent the time to identify, when items are prepended (#10), the size of the window is changed and repartitionPage
is called. However, after the call, the prepended item changes it position to the bottom! It doesn't quite make sense and requires more investigation.
On the flip side, for the mobile web world, the change in orientation will cause a resize and possibly that event should be binded on instead of simply a resize. I will look into adding that for mobile environments.
Heh. Think I know why that's happening. See my comment re: coordinate caching on #16. prepend
is calling updateCoords
with listItem
as the first arg, but listView.height
as the second, even in the case of a prepend. For prepends, it should pass 0
as the second arg -- since by definition a prepended item is offset from its parent by zero.
Repartitioning issue is fixed on #16. I still think that the mobile web use case needs to be resolved due to the weird fact that the resize
event fires as the page grows in size! This would be a huge detriment for performance and does not correctly reflect what is going on.
Need to think about how to handle this case instead. Hopefully the solution will not need to involve mobile browser detection.
This project is no longer maintained, and is deprecated.
Repartitioning is called unnecessarily due to the
window
being faux resized whenever an item is added to theListView
on a mobile web device.To work around this issue, an option is added to disable this functionality.