We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent91eae34 commit7810621Copy full SHA for 7810621
web-app/src/containers/Tutorial/components/Level.tsx
@@ -39,23 +39,22 @@ type Props = {
39
}
40
41
constLevel=({ level}:Props)=>{
42
-constpageBottomRef=React.useRef(null)
43
-constscrollToBottom=()=>{
+constpageTopRef=React.useRef(null)
+constscrollToTop=()=>{
44
//@ts-ignore
45
-pageBottomRef.current.scrollIntoView({behavior:'smooth'})
+pageTopRef.current.scrollIntoView({behavior:'smooth'})
46
47
-React.useEffect(scrollToBottom,[level.id])
+React.useEffect(scrollToTop,[level.id])
48
49
return(
50
<divcss={styles.page}>
51
+<divref={pageTopRef}/>
52
<divcss={styles.content}>
53
<Contenttitle={level.title}content={level.content}/>
54
55
{level.content.length&&level.steps.length ?<divcss={styles.separator}/> :null}
56
57
<Stepssteps={level.steps}/>
-
58
-<divref={pageBottomRef}/>
59
</div>
60
61
)