Reason for having `setHeight` be a callback in `_getRow` callback
tbranyen opened this issue · comments
Tim Branyen commented
When using generate
we now support returning an object with a height value. However, this used to be a callback and the specific use case is when the height is unknown until the element lands in the DOM.
Antoine Bluchet commented
Hmm might be slow.
- get element (height unknown), just append to the DOM (computes positioning based on itemHeight)
- get height => compute positioning again => redraw the showed element (here there will probably be a screen flick)
Or we need to:
- append to the DOM with opacity 0
- get element height from DOM
- compute positioning again
- redraw
Though, those are uneeded steps when height is known, and there will be more rendering.
Tim Branyen commented
What about two passes, first one lays everything out second pass sets correct offsets?
Tim Branyen commented
With this second approach I think it'd be doable without any HyperList code changes.
Antoine Bluchet commented
Yes indeed!