Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

rowPadding mostly applies to bottom? #99

Open
courajs opened this issue Apr 12, 2017 · 3 comments
Open

rowPadding mostly applies to bottom? #99

courajs opened this issue Apr 12, 2017 · 3 comments

Comments

@courajs
Copy link

courajs commented Apr 12, 2017

I'm not 100% on this, but I'm noticing un-rendered white flashes when scrolling upward, and increasing rowPadding doesn't seem to help. It does seem to help with white flashes when scrolling downward.

So, my guess is that the extra rows are only being rendered below the viewport, not above.

I had some trouble following all the math in virtual-each/component.js, but I got the impression that my guess is right.

Would you be open to rendering the extra rows around the viewport instead? It will introduce some more complexity to the scroll state around the top/bottom of the list.

@jasonmit
Copy link
Owner

Unsure I follow adding padding around viewport. Could you screen grab what you are seeing? (http://www.cockos.com/licecap/ If you need an app for this)

@courajs
Copy link
Author

courajs commented Apr 12, 2017

Sure. I'm specifying a rowHeight of 10 in the component:

  {{#virtual-each options
    height=containerHeight
    itemHeight=itemHeight
    rowPadding=10
    as |item actualIndex virtualIndex|
  }}
    ...
  {{/virtual-each}}

rowpadding

As you can see, the 10 rowPadding rows are rendered below the viewport, so scrolling down doesn't show a white flash. But no extra rows are rendered above the viewport, so scrolling up shows a white flash.

A rowPadding of 10 should probably render 5 above and 5 below, or 10 above and 10 below, rather than just 10 below.

@jasonmit
Copy link
Owner

jasonmit commented Apr 13, 2017

Agreed, should be buffered in both directions. Happily would accept the change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants