@@ -1,5 +1,4 @@
|
||||
html,
|
||||
body {
|
||||
.disable-scroll-x-behavior {
|
||||
overscroll-behavior-x: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,13 @@ const App = ({ Component, pageProps }: AppProps) => {
|
||||
const { query, pathname } = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
pathname.endsWith('/edit')
|
||||
? (document.body.style.overflow = 'hidden')
|
||||
: (document.body.style.overflow = 'auto')
|
||||
if (pathname.endsWith('/edit')) {
|
||||
document.body.style.overflow = 'hidden'
|
||||
document.body.classList.add('disable-scroll-x-behavior')
|
||||
} else {
|
||||
document.body.style.overflow = 'auto'
|
||||
document.body.classList.remove('disable-scroll-x-behavior')
|
||||
}
|
||||
}, [pathname])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user