vertical-collection icon indicating copy to clipboard operation
vertical-collection copied to clipboard

latest version with embroider doesn't add elements as you scroll

Open BryanCrotaz opened this issue 1 year ago • 2 comments

items is a static array of complex objects generated asynchronously Not loading vertical-collection until the objects are ready It shows the first two (or more if buffer size arg is used) but never shows the rest. I'd expect them to appear as the user scrolls down. The closing occluded content has the correct initial height but the opening content always has a height of 0 and the closing content height doesn't change

<div style="height: 100vh;">
  {{#let (await this.pages) as |pages|}}
    {{#if pages}}
      <VerticalCollection 
        @items={{pages}}
        @estimateHeight="868" 
        @key="_pageIndex"
        as | page |>
        <div page={{page._pageIndex}} {{render-pdf-page page}} />
      </VerticalCollection>
    {{/if}}
  {{/let}}
</div>

BryanCrotaz avatar Nov 10 '22 03:11 BryanCrotaz

Turns out you need to add overflow:auto on the outer container. It would be nice if the docs mentioned this sort of thing if it's compulsory.

BryanCrotaz avatar Nov 10 '22 03:11 BryanCrotaz

It's designed to work with whatever CSS you bring, but that does have constraints (if you want div vs body scrolling that needs to be setup, and the layout can't have errors meaning the browser needs to be able to correctly ascertain the positioning and height, which lots of folks don't realize they write broken css but lots of layouts are broken)

runspired avatar Nov 17 '22 20:11 runspired