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

Error: Assertion Failed: value must non-negative

Open ghost opened this issue 6 years ago • 3 comments

when using vertical-collection within a div that has column-count > 1 style property the scroller fails with this error:

Error: Assertion Failed: value must non-negative

controller:

import Controller from '@ember/controller';

export default class ApplicationController extends Controller {
  sample = [
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
    {nr: 1},
  ]
}

hbs:

<div style="column-count: 3">
  <div>first</div>

  <div class="table-wrapper dark" style="height:500px; overflow: scroll">
    {{#vertical-collection sample estimateHeight=90 bufferSize=5 as |item index|}}
      <div style="height: 80px; margin: 5px; background: red ">{{item.nr}} -> {{index}}</div>
    {{/vertical-collection}}
  </div>
</div>

ghost avatar Nov 18 '18 23:11 ghost

Also seeing this. When it happens, the whole app crashes and you can't click any link-to's etc. On beta.13.

oskarrough avatar Jan 11 '19 09:01 oskarrough

I'm using ember-table and am getting the exact same error and symptoms (crashing the whole app). Anybody have any solutions after a year?

octabode avatar Dec 30 '19 18:12 octabode

For what it's worth, I came across this error (seems like the height of something was getting calculated as negative during the measurement phase), and I was able to work around it by setting staticHeight=true in my usage (since I didn't need any of the dynamic loading pieces, luckily). Hopefully that helps anyone that comes across this in the future!

ryanvidal avatar Oct 20 '21 13:10 ryanvidal