-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Open
Copy link
Labels
Description
Describe the bug
Although the rootMargin
value in the UseElementVisibilityOptions
type appears to support responsiveness, the actual implementation does not take responsiveness into account.
and personally, considering the purpose of this composable, I think it might make more sense not to accept the rootMargin property at all.
On StackBlitz, rootMargin
doesn't seem to work correctly—possibly due to viewport issues. I recommend running the reproduction locally for more accurate results.
Reproduction
https://stackblitz.com/edit/vitejs-vite-eeuwym9e
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@vueuse/core: ^13.6.0 => 13.6.0
vue: ^3.5.18 => 3.5.18
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a VueUse issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.