Skip to content

Commit 6d5fb0a

Browse files
authored
Merge pull request #787 from topcoder-platform/issue-776
Scroll bar is not getting reset when going through the steps
2 parents 1150573 + 70504b0 commit 6d5fb0a

File tree

1 file changed

+9
-1
lines changed
  • src/apps/onboarding/src/pages/onboarding

1 file changed

+9
-1
lines changed

src/apps/onboarding/src/pages/onboarding/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FC, useContext, useEffect } from 'react'
2-
import { Outlet, Routes } from 'react-router-dom'
2+
import { Outlet, Routes, useLocation } from 'react-router-dom'
33
import { connect, Provider } from 'react-redux'
44
import classNames from 'classnames'
55

@@ -53,6 +53,14 @@ const OnboardingFooter: any = connect(mapStateToProps, mapDispatchToProps)(Onboa
5353
const OnboardingContent: FC<{
5454
}> = () => {
5555
const { getChildRoutes }: RouterContextData = useContext(routerContext)
56+
const location = useLocation()
57+
58+
useEffect(
59+
() => {
60+
window.scrollTo(0, 0)
61+
},
62+
[location.pathname],
63+
)
5664

5765
return (
5866
<>

0 commit comments

Comments
 (0)