adobe / uxp-optimized

Repository for uxp optimized react and javascript components.
MIT License
16 stars 7 forks source link

Fix lag between getRect(key) and other elements being rendered #24

Open alanpeevers opened 3 years ago

alanpeevers commented 3 years ago

Expected Behaviour

virtualizer.getRect() should be in sync with the rest of the elements being rendered.

Actual Behaviour

In UXP, when we resize our grid of cards, the thumbnails positions lag behind (they're spaced too closely when we're increasing the size, and too far apart when we're decreasing it). We tried moving the getRect to componentDidUpdate() but that did not help.

Reproduce Scenario (including but not limited to)

Our case can be seen by running the UXP Importer panel in Premiere Pro (lengthy setup). Or just use the getRect call on Virtualizer to send position data to a grid of elements that renders them at those positions. See the lag as you change the spacing of the elements in that grid.

Steps to Reproduce

If you run the uxp importer, just move the slider up and down to see the lag between thumbnails and card backgrounds.

Platform and Version

UXP on Mac and Win

Sample Code that illustrates the problem

UXP Importer panel in MediaVirtualizer.tsx

Logs taken while reproducing problem