Skip to content

Commit

Permalink
Merge pull request #495 from Twenty-Three-Fifty-Nine/376-scroll-to-bo…
Browse files Browse the repository at this point in the history
…ttom-if-new-assessment-card-goes-off-screen

376 scroll to bottom if new assessment card goes off screen
  • Loading branch information
JJeeff248 authored Feb 26, 2024
2 parents e7e833f + 5bbbb31 commit 7f278ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<title>Twenty Three Fifty Nine</title>

<style>
html {
scroll-behavior: smooth;
}
</style>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
3 changes: 3 additions & 0 deletions src/course-viewer/CourseViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ const CourseViewer = (props) => {
setCurrentEdit(newAss);
setChangesMade(true);
setValidChanges(false);
setTimeout(() => {
window.scrollTo(0, document.body.scrollHeight);
}, 250);
}}
> Add Assessment </Button>
</Stack>
Expand Down

0 comments on commit 7f278ad

Please sign in to comment.