microsoft / backbone-virtualized-listview

Backbone list view with virtualization support
20 stars 12 forks source link

Redraw immediately on data change, do not wait for animation frame #7

Closed lyweiwei closed 7 years ago

lyweiwei commented 7 years ago

Problem

After the data is updated, we scheduled a redraw. However, this won't happen until the next animation frame. If the user switch to another browser tab, the redraw would be delayed for unlimited period. This will cause problem if people want to log the rendering performance.

Fix

Only use animation frame for scrolling scenarios. If there's data change, schedule a redraw on next tick.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.3%) to 99.691% when pulling b906540b5ed95c6ce87b012538f4d226dfb1afbc on lyweiwei:force-redrew into e21366bb4a0df7ee68e2fea2a9ec43606b5bb521 on Microsoft:master.