ademilter / bricklayer

Lightweight and independent Pinterest-like cascading grid layout library
http://bricklayer.js.org
Other
2.46k stars 121 forks source link

Redraw causing the page to scroll back to the top #20

Open stramel opened 8 years ago

stramel commented 8 years ago

bricklayer.redraw() is causing the page to scroll to the top. I was previously using masonry and didn't run across this issue. Is there a way to prevent this?

f commented 8 years ago

Actually, yes. But we did not handle this. redraw calculates and repositions all the items, meanwhile removes all the content which reset scroll position. We should store scroll position just before redrawing, and when just after redraw, we should set the scrollTop position back.