You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.
In certain situations, the itemHeight property that is passed into the component could start with 0, which then will be updated once the application is ready. This is because we simply try to avoid setting a static number that may or may not be correct. In other languages, the itemHeight could be taller, and therefore could pose some incorrect number.
{{#virtual-eachsomeNamesheight=listHeightitemHeight=listItemHeightas | name |}}{{displayed-namename=nameonInsert=(action (mutlistItemHeight))}}{{/virtual-each}}
Where in components/displayed-name.js:
didInsertElement(){this._super();this.sendAction('onInsert',this.$().height());// Set the height}
and itemHeight is initiated with 0 in the controllers/foo.js.
Problem is that, until the listItemHeight is updated, the itemHeight property will always be 0, and this is causing the _itemCount to always produce Infinity value.
Because there's a line in visibleItems where let endAt = Math.min(itemsLength, _startAt + _itemCount);, this will always mean that all of the items is visible at first, in which the DOM will try to draw all items first. In large data set (1000+), this chokes the browser.
I'm proposing that we change the logic to return the bufferSize if neither height or itemHeight is more than 0.
In certain situations, the
itemHeight
property that is passed into the component could start with0
, which then will be updated once the application is ready. This is because we simply try to avoid setting a static number that may or may not be correct. In other languages, theitemHeight
could be taller, and therefore could pose some incorrect number.Where in
components/displayed-name.js
:and
itemHeight
is initiated with0
in thecontrollers/foo.js
.Problem is that, until the
listItemHeight
is updated, theitemHeight
property will always be0
, and this is causing the_itemCount
to always produceInfinity
value.Because there's a line in
visibleItems
wherelet endAt = Math.min(itemsLength, _startAt + _itemCount);
, this will always mean that all of the items is visible at first, in which the DOM will try to draw all items first. In large data set (1000+), this chokes the browser.I'm proposing that we change the logic to return the
bufferSize
if neitherheight
oritemHeight
is more than0
.I could submit the change, but would love to run it by you first.
Let me know what you think! 😃
The text was updated successfully, but these errors were encountered: