Skip to content

Commit

Permalink
Fix issue with tg no scroll in ios where it still scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Jun 11, 2024
1 parent fb47afc commit 2fa8226
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useTgNoScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { useEffect } from 'react'
export default function useTgNoScroll() {
useEffect(() => {
const overflow = 500
document.body.style.overflowY = 'hidden'
document.body.style.overflow = 'hidden'
document.body.style.paddingTop = `${overflow}px`
document.body.style.height = window.innerHeight + overflow + 'px !important'
document.body.style.paddingBottom = `${overflow}px`
window.scrollTo(0, overflow)

return () => {
document.body.style.overflowY = 'initial'
document.body.style.overflow = 'initial'
document.body.style.paddingTop = '0'
document.body.style.height = 'auto'
document.body.style.paddingBottom = '0'
Expand Down

0 comments on commit 2fa8226

Please sign in to comment.