There is a SPA-application on Backbone + Marionette. When rendering to the CollectionView region with a large number of elements, a scrollbar appears on the page. After the number of elements of the collection is changed to a smaller side, the height of the page decreases, but the scrollbar remains the same, forming an extra empty space under the page. Tell me, how can I use native JS or JQuery to make the page recalculate the height and change the scrollbar?

  • Let's just say the question is very abstract, and therefore it is difficult to answer it. Here you have to look at everything, the template of the item, the template of the page, and the CSS for all this. I have never had such problems with collections, even with large collections. Try to sketch an example on jsfiddle.net maybe you can analyze it. - Aries Ua
  • This happens within a fairly large project, with the use of requireJS, because the import to JSFIddle will take a lot of time, and it may not appear on a simple example. I just thought that there might be any decisions on the scrollbar refresh out of the box - arnage
  • Project size does not matter. I think you need to pay more attention to the layout and styles of exactly those blocks where the render of the collection takes place. Also check in different browsers. There is also an assumption that you set the height of the block, but do not reset when decreasing. - Aries Ua

0