diff --git a/packages/core/useElementVisibility/index.ts b/packages/core/useElementVisibility/index.ts index 167abffb006..9deac8c6ef5 100644 --- a/packages/core/useElementVisibility/index.ts +++ b/packages/core/useElementVisibility/index.ts @@ -1,5 +1,4 @@ import type { MaybeComputedRef } from '@vueuse/shared' -import { tryOnScopeDispose } from '@vueuse/shared' import { ref, watch } from 'vue-demi' import type { MaybeComputedElementRef } from '../unrefElement' import { unrefElement } from '../unrefElement' @@ -44,7 +43,7 @@ export function useElementVisibility( } } - const stop = watch( + watch( () => unrefElement(element), () => testBounding(), { immediate: true, flush: 'post' }, @@ -56,7 +55,5 @@ export function useElementVisibility( }) } - tryOnScopeDispose(() => stop()) - return elementIsVisible }