0

I'm facing an issue with an SPFx web part with a large UI. When users scroll down one page and click a link which changes the page, there seems to be no way to programmatically scroll to the top of the web part. I've tried all the usual methods such as scrollIntoView to a div at the top and scrollTo and nothing seems to work. Is there any way to scroll inside an SPFx web part?

1 Answers1

1

In other post someone has used windows.scrollTo(0,0) event in react and it works. you can place a button or arrow which can use this property to move top or in the bottom.

componentDidMount() {
window.scrollTo(0, 0)
}

Scroll to the top of the page after render in react.js