Skip to content

BUG | useElementVisibility | rootMargin marked as responsive, but not implemented #4930

@akfakf0509

Description

@akfakf0509

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas pr

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions