Forum Discussion
spfx web parts not rendered on page load until scrolled to
Hi stchiew,
You're right. This is default behavior for modern pages in SharePoint. Maybe it was working before because your page was not long enough to not load some webparts?
I can see how that would be a problem for you, though. What you could do is group your webparts together inside a big webpart. I've done that for other reasons but surely it would to solve your problem, too. Or you could change the logic of your custom nav.
Let me know if you need any help.
- stchiewJul 13, 2020Copper Contributor
Carlos_Marins thanks for your reply!
I'm pretty sure it worked earlier this year with some very long pages. Actually this is the web part solution I am trying to implement from the spfx PnP Sample repos https://github.com/pnp/sp-dev-fx-webparts/tree/master/samples/react-page-sections-navigation , so it really depends on all subsequent web parts to be loaded and registered as a data source before the top navigation displays all links.
I did some more testing, with the standard Hello World web part at the bottom of a simple modern page with many OOTB webparts, both in a Targeted Release tenant and a Standard Release tenant and got different results! Seems in targeted release the web part is loaded in full on page load, while in the latter release it doesn't. So my web part works in target but not in standard. Below are snapshots from browser dev tools, upon page load without scrolling. (Hoping these changes will be rolled out to standard release tenants soon)
Standard Release - there's a div data-viewport-id, but the rest of the webpart is not rendered.
Target release tenant - the WP is rendered without scrolling, without the div data-viewport-id tag