Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e08106

Browse files
authored
Merge pull request#123 from ShMcK/feature/scroll-to-page-bottom
closes#118. Scroll to bottom on save
2 parentsca0b510 +ac68ba0 commit6e08106

File tree

1 file changed

+8
-0
lines changed
  • web-app/src/containers/Tutorial/LevelPage

1 file changed

+8
-0
lines changed

‎web-app/src/containers/Tutorial/LevelPage/Level.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,15 @@ const Level = ({ level, onContinue, onLoadSolution, processes, testStatus }: Pro
8282
thrownewError('No Stage steps found')
8383
}
8484

85+
constpageBottomRef=React.useRef(null)
86+
87+
constscrollToBottom=()=>{
88+
//@ts-ignore
89+
pageBottomRef.current.scrollIntoView({behavior:'smooth'})
90+
}
8591
//@ts-ignore
8692
constcurrentStep=level.steps.findIndex(s=>s.status==='ACTIVE')
93+
React.useEffect(scrollToBottom,[currentStep])
8794

8895
return(
8996
<divcss={styles.page}>
@@ -113,6 +120,7 @@ const Level = ({ level, onContinue, onLoadSolution, processes, testStatus }: Pro
113120
)
114121
})}
115122
</div>
123+
<divref={pageBottomRef}/>
116124
</div>
117125

118126
{(testStatus||processes.length>0)&&(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp