-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Describe the bug
While useMouse is totally correct to not update x or y value on scroll, this is not what should happen for the value of elementX, elementY and isOutside on useMouseInElement when the element is not sticky.
If I scroll on a page the position of the mouse is not changing which is correct, but scrolling move elements in the page thus changing the position of the mouse in this element.
Since useMouseInElement is not updating elementX, elementY and isOutside, on scroll they end up been false.
To reproduce the problem you can use the doc :
place your cursor in the element then scoll, the elementX, elementY are not updating and if you scroll until the cursor is out of the element isOutside is still at false.
Reproduction
https://vueuse.org/core/useMouseInElement/
System Info
System:
OS: macOS 13.2.1
CPU: (8) arm64 Apple M1
Memory: 119.64 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
Browsers:
Chrome: 111.0.5563.146
Firefox: 111.0
Safari: 16.3
npmPackages:
@vueuse/core: ^9.13.0 => 9.13.0
vue: ^3.2.47 => 3.2.47
Used Package Manager
pnpm
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.