Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useMouseInElement Returns isOutside: true When Scrolling in Nuxt3 #4186

Open
7 tasks done
lhoucinecherif opened this issue Aug 30, 2024 · 3 comments
Open
7 tasks done

Comments

@lhoucinecherif
Copy link

Describe the bug

I'm experiencing an issue with the useMouseInElement function from VueUse in a Nuxt3 project. The isOutside value always returns true when I scroll the page whithout moving the mouse, even if the mouse is inside the element.

Reproduction

https://stackblitz.com/edit/vitejs-vite-iwn1w4?file=src%2FApp.vue

System Info

System:
    OS: Linux 6.8 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (16) x64 Intel(R) Xeon(R) CPU           E5640  @ 2.67GHz
    Memory: 11.56 GB / 23.49 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.15.0/bin/yarn
    npm: 10.8.1 - ~/.nvm/versions/node/v20.15.0/bin/npm
    pnpm: 9.4.0 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 126.0.6478.126
  npmPackages:
    @vueuse/components: ^11.0.3 => 11.0.3 
    @vueuse/nuxt: ^10.11.1 => 10.11.1

Used Package Manager

pnpm

Validations

@mickaelchanrion
Copy link

Hey there 👋

I noticed this strange behavior too while using useMouseInElement with type page. It is also visible in the demo here.

If I scroll without moving the mouse, not only isOutside but also y and elementY get off. I guess it would be the same for x values in case the page was with a horizontal scroll.

Screen.Recording.2024-09-13.at.00.38.15.mov

I could see that this composable uses useMouse under the hood and the demo has the same behavior so the culprit is this composable.

Screen.Recording.2024-09-13.at.01.02.33.mov

@Luca-Sett
Copy link

I'm also seeing both of these issues - has anyone found a solution?

@ilyaliao
Copy link
Contributor

I think #4244 already fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants