Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jan 3, 2023
1 parent df5c078 commit b4f82d7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/core/useScrollLock/index.ts
Expand Up @@ -5,19 +5,17 @@ import { isIOS, resolveRef, resolveUnref, tryOnScopeDispose } from '@vueuse/shar
import { useEventListener } from '../useEventListener'

function checkOverflowScroll(ele: Element): boolean {
const _style = window.getComputedStyle(ele)
if (_style.overflowX === 'scroll' || _style.overflowY === 'scroll') {
const style = window.getComputedStyle(ele)
if (style.overflowX === 'scroll' || style.overflowY === 'scroll') {
return true
}
else {
const _parent = ele.parentNode as Element
const parent = ele.parentNode as Element

if (_parent.tagName === 'BODY')
if (!parent || parent.tagName === 'BODY')
return false

if (checkOverflowScroll(_parent))
return true
else return false
return checkOverflowScroll(parent)
}
}

Expand Down

0 comments on commit b4f82d7

Please sign in to comment.