Skip to content

Commit 5f8dd94

Browse files
authored
Merge pull request #440 from timlrx/fix/scroll
fix: remove smoothscroll-polyfill
2 parents 3e9116b + 0c46069 commit 5f8dd94

File tree

3 files changed

+1
-9
lines changed

3 files changed

+1
-9
lines changed

components/ScrollTopAndComment.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import siteMetadata from '@/data/siteMetadata'
22
import { useEffect, useState } from 'react'
3-
import smoothscroll from 'smoothscroll-polyfill'
43

54
const ScrollTopAndComment = () => {
65
const [show, setShow] = useState(false)
76

87
useEffect(() => {
9-
smoothscroll.polyfill()
108
const handleWindowScroll = () => {
119
if (window.scrollY > 50) setShow(true)
1210
else setShow(false)
@@ -17,7 +15,7 @@ const ScrollTopAndComment = () => {
1715
}, [])
1816

1917
const handleScrollTop = () => {
20-
window.scrollTo({ top: 0, behavior: 'smooth' })
18+
window.scrollTo({ top: 0 })
2119
}
2220
const handleScrollToComment = () => {
2321
document.getElementById('comment').scrollIntoView()

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"remark-gfm": "^3.0.1",
4040
"remark-math": "^5.1.1",
4141
"sharp": "^0.28.3",
42-
"smoothscroll-polyfill": "^0.4.4",
4342
"tailwindcss": "^3.0.23",
4443
"unist-util-visit": "^4.0.0"
4544
},

0 commit comments

Comments
 (0)