Addepar / ember-table

https://opensource.addepar.com/ember-table/
Other
1.69k stars 352 forks source link

Compare offsetHeight/getComputedStyle at scale #1054

Closed mixonic closed 9 months ago

mixonic commented 9 months ago

At very large heights based on many child elements, Chrome and even Firefox begin to diverge the computed height values from what you see at lower scales. This makes their comparison with offsetHeight less reliable at high scales.

However, at large height values the exactness of the height measurement also matters less. At the end, only a limited level of precision is desired in the scale value and later code throws away noise at the lower end.

So, use a more forgiving comparison methodology (% shift in the change) vs requiring the two values to be only a single digit off.

I've asserted this on a table in our product which triggers the exception with a height of 100877px, but not below that number. This fix as written avoids the exception.